From 0deeab6aee62df9601e2b0c345b0d364cb8228f0 Mon Sep 17 00:00:00 2001 From: Nicolas Roard Date: Tue, 1 Mar 2011 12:46:27 -0800 Subject: Fix Browser ANR The dtor of GLWebViewState is calling the dtor of its TiledPage variables; the dtor of TiledPage wait until any pending painting operations running in the TextureGenerator thread are done. The painting operations ultimately paint using the current GLWebViewState's base layer. We were doing unref() on the baselayer before destroying the TiledPage... bug:3429924 Change-Id: I685e7fca5e5bae796f808debbf7e4ce668b83e6b --- WebCore/platform/graphics/android/GLWebViewState.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'WebCore/platform') diff --git a/WebCore/platform/graphics/android/GLWebViewState.cpp b/WebCore/platform/graphics/android/GLWebViewState.cpp index c25a6e8..5e1285f 100644 --- a/WebCore/platform/graphics/android/GLWebViewState.cpp +++ b/WebCore/platform/graphics/android/GLWebViewState.cpp @@ -96,9 +96,15 @@ GLWebViewState::GLWebViewState(android::Mutex* buttonMutex) GLWebViewState::~GLWebViewState() { - SkSafeUnref(m_currentBaseLayer); + // We have to destroy the two tiled pages first as their destructor + // may depend on the existence of this GLWebViewState and some of its + // instance variables in order to complete. + // Explicitely, currently we need to have the m_currentBaseLayer around + // in order to complete any pending paint operations (the tiled pages + // will remove any pending operations, and wait if one is underway). delete m_tiledPageA; delete m_tiledPageB; + SkSafeUnref(m_currentBaseLayer); #ifdef DEBUG_COUNT ClassTracker::instance()->decrement("GLWebViewState"); #endif -- cgit v1.1