From c34cfbd2a0063c85afcf6751478987b8c6b6f7e1 Mon Sep 17 00:00:00 2001 From: Chris Craik Date: Mon, 5 Dec 2011 17:26:07 -0800 Subject: Delete TextureGenerator operations outside the lock bug:5713701 This fixes a potential deadlock between TextureGenerator and ImagesManager Change-Id: I57503d3b73aff571629826f2278491232b37cb67 --- Source/WebCore/platform/graphics/android/TexturesGenerator.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Source') diff --git a/Source/WebCore/platform/graphics/android/TexturesGenerator.cpp b/Source/WebCore/platform/graphics/android/TexturesGenerator.cpp index 0820688..bccb99b 100644 --- a/Source/WebCore/platform/graphics/android/TexturesGenerator.cpp +++ b/Source/WebCore/platform/graphics/android/TexturesGenerator.cpp @@ -184,11 +184,10 @@ bool TexturesGenerator::threadLoop() m_currentOperation->run(); } + QueuedOperation* oldOperation = m_currentOperation; mRequestedOperationsLock.lock(); - if (m_currentOperation) { - delete m_currentOperation; + if (m_currentOperation) m_currentOperation = 0; - } if (!mRequestedOperations.size()) stop = true; if (m_waitForCompletion) { @@ -197,7 +196,8 @@ bool TexturesGenerator::threadLoop() mRequestedOperationsCond.signal(); } mRequestedOperationsLock.unlock(); - + if (oldOperation) + delete oldOperation; // delete outside lock } XLOG("threadLoop empty"); -- cgit v1.1