summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2021-12-09 01:45:06 +0000
committerMoonchild <moonchild@palemoon.org>2022-04-03 01:04:29 +0200
commitfd59fd55a242f913fa828bc4e3477d47546d6bb4 (patch)
tree48feacbfb1f67983a5d3ef1762d2a44f794ceac8
parent2c2b3ab1ba1a9da16f0b0a6145afc0b3f744b0f9 (diff)
downloaduxp-fd59fd55a242f913fa828bc4e3477d47546d6bb4.tar.gz
[XPCOM] Use swap in nsThread::SetObserver.
-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;
}