diff --git a/gfx/layers/ipc/CompositorParent.cpp b/gfx/layers/ipc/CompositorParent.cpp index 0ab140ff404e..b3ff163875b5 100644 --- a/gfx/layers/ipc/CompositorParent.cpp +++ b/gfx/layers/ipc/CompositorParent.cpp @@ -1249,6 +1249,7 @@ CompositorParent* CompositorParent::RemoveCompositor(uint64_t id) bool CompositorParent::RecvNotifyChildCreated(const uint64_t& child) { + MonitorAutoLock lock(*sIndirectLayerTreesLock); NotifyChildCreated(child); return true; } @@ -1256,7 +1257,7 @@ CompositorParent::RecvNotifyChildCreated(const uint64_t& child) void CompositorParent::NotifyChildCreated(const uint64_t& aChild) { - MonitorAutoLock lock(*sIndirectLayerTreesLock); + sIndirectLayerTreesLock->AssertCurrentThreadOwns(); sIndirectLayerTrees[aChild].mParent = this; sIndirectLayerTrees[aChild].mLayerManager = mLayerManager; } @@ -1264,8 +1265,8 @@ CompositorParent::NotifyChildCreated(const uint64_t& aChild) bool CompositorParent::RecvAdoptChild(const uint64_t& child) { - NotifyChildCreated(child); MonitorAutoLock lock(*sIndirectLayerTreesLock); + NotifyChildCreated(child); if (sIndirectLayerTrees[child].mLayerTree) { sIndirectLayerTrees[child].mLayerTree->mLayerManager = mLayerManager; }