diff --git a/gfx/layers/ipc/SharedBufferManagerParent.cpp b/gfx/layers/ipc/SharedBufferManagerParent.cpp index 059140c3cbe..243707d4e7c 100644 --- a/gfx/layers/ipc/SharedBufferManagerParent.cpp +++ b/gfx/layers/ipc/SharedBufferManagerParent.cpp @@ -43,11 +43,15 @@ public: NS_IMETHOD CollectReports(nsIHandleReportCallback* aHandleReport, nsISupports* aData, bool aAnonymize) { + if (SharedBufferManagerParent::sManagerMonitor) { + SharedBufferManagerParent::sManagerMonitor->Lock(); + } map::iterator it; for (it = SharedBufferManagerParent::sManagers.begin(); it != SharedBufferManagerParent::sManagers.end(); it++) { base::ProcessId pid = it->first; SharedBufferManagerParent *mgr = it->second; + MutexAutoLock lock(mgr->mBuffersMutex); std::map >::iterator buf_it; for (buf_it = mgr->mBuffers.begin(); buf_it != mgr->mBuffers.end(); buf_it++) { nsresult rv; @@ -72,10 +76,16 @@ public: "conditions."), aData); if (rv != NS_OK) { + if (SharedBufferManagerParent::sManagerMonitor) { + SharedBufferManagerParent::sManagerMonitor->Unlock(); + } return rv; } } } + if (SharedBufferManagerParent::sManagerMonitor) { + SharedBufferManagerParent::sManagerMonitor->Unlock(); + } return NS_OK; }