From 5550319aaa0f9d0a05283a10971fc3240b9ed8eb Mon Sep 17 00:00:00 2001 From: Mattias Falk Date: Tue, 5 Jun 2012 11:56:15 +0200 Subject: Don't use deleted Node object in setSizeScreenWidthAndScale The call to forceLayout may cause the Node object to be deleted. Avoid crash by check that the Node object is still valid when forceLayout has returned. Change-Id: Ieb74a59ca7f2e457b3b17d01bcb02cd566f84ef2 --- Source/WebKit/android/jni/WebViewCore.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source') diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp index 1e406b1..1b53a6e 100644 --- a/Source/WebKit/android/jni/WebViewCore.cpp +++ b/Source/WebKit/android/jni/WebViewCore.cpp @@ -1359,7 +1359,7 @@ void WebViewCore::setSizeScreenWidthAndScale(int width, int height, m_mainFrame->view()->forceLayout(); // scroll to restore current screen center - if (node) { + if (node && node->inDocument()) { const WebCore::IntRect& newBounds = node->getRect(); DBG_NAV_LOGD("nb:(x=%d,y=%d,w=%d," "h=%d)", newBounds.x(), newBounds.y(), -- cgit v1.1