[BlackBerry] Fix crash in InputHandler
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Jun 2012 17:28:59 +0000 (17:28 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Jun 2012 17:28:59 +0000 (17:28 +0000)
https://bugs.webkit.org/show_bug.cgi?id=88808

Patch by Crystal Zhang <haizhang@rim.com> on 2012-06-12
Reviewed by Antonio Gomes.

m_page is destroyed before InputHandler, so should move the call to destroy popup to chromeDestroyed().

* WebCoreSupport/ChromeClientBlackBerry.cpp:
(WebCore::ChromeClientBlackBerry::chromeDestroyed():
* WebKitSupport/InputHandler.cpp:
(BlackBerry::WebKit::InputHandler::~InputHandler):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@120091 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/blackberry/ChangeLog
Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp
Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp

index 87fbbab..1faec5a 100644 (file)
@@ -1,3 +1,17 @@
+2012-06-12  Crystal Zhang  <haizhang@rim.com>
+
+        [BlackBerry] Fix crash in InputHandler
+        https://bugs.webkit.org/show_bug.cgi?id=88808
+
+        Reviewed by Antonio Gomes.
+
+        m_page is destroyed before InputHandler, so should move the call to destroy popup to chromeDestroyed().
+
+        * WebCoreSupport/ChromeClientBlackBerry.cpp:
+        (WebCore::ChromeClientBlackBerry::chromeDestroyed():
+        * WebKitSupport/InputHandler.cpp:
+        (BlackBerry::WebKit::InputHandler::~InputHandler):
+
 2012-06-12  Yong Li  <yoli@rim.com>
 
         [BlackBerry] Use a safer way to shrink JS memory usage
index 52f90a4..5862a20 100644 (file)
@@ -148,6 +148,8 @@ bool ChromeClientBlackBerry::runJavaScriptPrompt(Frame* frame, const String& mes
 
 void ChromeClientBlackBerry::chromeDestroyed()
 {
+    // Destroy popup if we have.
+    closePagePopup(0);
     delete this;
 }
 
index 9944a9d..c563ad2 100644 (file)
@@ -125,7 +125,6 @@ InputHandler::InputHandler(WebPagePrivate* page)
 
 InputHandler::~InputHandler()
 {
-    m_webPage->m_page->chrome()->client()->closePagePopup(0);
 }
 
 static BlackBerryInputType convertInputType(const HTMLInputElement* inputElement)