From 209a4ad3a3c64301f96db004c56dfc34d139ade6 Mon Sep 17 00:00:00 2001 From: Nicolas Silva Date: Wed, 27 Aug 2014 16:50:25 +0200 Subject: [PATCH] Bug 1016538 - Fix unbalanced locking logic in tiling. r=Bas --- gfx/layers/client/TiledContentClient.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gfx/layers/client/TiledContentClient.cpp b/gfx/layers/client/TiledContentClient.cpp index d10870d89d54..c6eeed1d7940 100644 --- a/gfx/layers/client/TiledContentClient.cpp +++ b/gfx/layers/client/TiledContentClient.cpp @@ -349,6 +349,7 @@ gfxMemorySharedReadLock::gfxMemorySharedReadLock() gfxMemorySharedReadLock::~gfxMemorySharedReadLock() { + MOZ_ASSERT(mReadCount == 0); MOZ_COUNT_DTOR(gfxMemorySharedReadLock); } @@ -761,6 +762,11 @@ TileClient::GetBackBuffer(const nsIntRegion& aDirtyRegion, if (aMode == SurfaceMode::SURFACE_COMPONENT_ALPHA) { mBackBufferOnWhite = pool->GetTextureClient(); } + + if (mBackLock) { + // Before we Replacing the lock by another one we need to unlock it! + mBackLock->ReadUnlock(); + } // Create a lock for our newly created back-buffer. if (mManager->AsShadowForwarder()->IsSameProcess()) { // If our compositor is in the same process, we can save some cycles by not