summaryrefslogtreecommitdiff
path: root/xpcom/threads/nsThread.cpp
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2021-12-09 01:45:06 +0000
committerMoonchild <moonchild@palemoon.org>2022-04-07 23:56:24 +0200
commitb76d12c2bd9a823bfd536763493e25eb56adb5b5 (patch)
tree57977bbc6fa900ef29fad4e2a113c2ce8d887d77 /xpcom/threads/nsThread.cpp
parent57dffbd698fb738695513536e79c9c614bf5c4c0 (diff)
downloaduxp-b76d12c2bd9a823bfd536763493e25eb56adb5b5.tar.gz
[XPCOM] Use swap in nsThread::SetObserver.
Diffstat (limited to 'xpcom/threads/nsThread.cpp')
-rw-r--r--xpcom/threads/nsThread.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/xpcom/threads/nsThread.cpp b/xpcom/threads/nsThread.cpp
index 5e5b89d18f..ed67fa6594 100644
--- a/xpcom/threads/nsThread.cpp
+++ b/xpcom/threads/nsThread.cpp
@@ -1217,7 +1217,8 @@ nsThread::SetObserver(nsIThreadObserver* aObs)
}
MutexAutoLock lock(mLock);
- mObserver = aObs;
+ nsCOMPtr<nsIThreadObserver> observer = aObs;
+ mObserver.swap(observer);
return NS_OK;
}