diff --git a/widget/windows/JumpListBuilder.cpp b/widget/windows/JumpListBuilder.cpp index ff0797f39504..b74c3f1529cd 100644 --- a/widget/windows/JumpListBuilder.cpp +++ b/widget/windows/JumpListBuilder.cpp @@ -107,6 +107,7 @@ JumpListBuilder::JumpListBuilder() return; } + ReentrantMonitorAutoEnter lock(mMonitor); // Since we are accessing mJumpListMgr across different threads // (ie, different apartments), mJumpListMgr must be an agile reference. mJumpListMgr = jumpListMgr; @@ -140,6 +141,7 @@ JumpListBuilder::~JumpListBuilder() { NS_IMETHODIMP JumpListBuilder::SetAppUserModelID( const nsAString& aAppUserModelId) { + ReentrantMonitorAutoEnter lock(mMonitor); if (!mJumpListMgr) return NS_ERROR_NOT_AVAILABLE; RefPtr jumpListMgr = mJumpListMgr;