2009-11-19 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
authoreric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Nov 2009 14:04:26 +0000 (14:04 +0000)
committereric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Nov 2009 14:04:26 +0000 (14:04 +0000)
        Reviewed by Kenneth Rohde Christiansen.

        [Qt] Fix QWebInspector destruction problem.
        https://bugs.webkit.org/show_bug.cgi?id=31664

        * Api/qwebpage.cpp:
        (QWebPage::~QWebPage):

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

WebKit/qt/Api/qwebpage.cpp
WebKit/qt/ChangeLog

index 9657cb15242a338a39b1505b281752ee4d83a951..99a08df32109fce0b4d9cb85b58607aebdf99c2e 100644 (file)
@@ -1685,8 +1685,14 @@ QWebPage::~QWebPage()
     FrameLoader *loader = d->mainFrame->d->frame->loader();
     if (loader)
         loader->detachFromParent();
-    if (d->inspector)
-        d->inspector->setPage(0);
+    if (d->inspector) {
+        // Since we have to delete an internal inspector,
+        // call setInspector(0) directly to prevent potential crashes
+        if (d->inspectorIsInternalOnly)
+            d->setInspector(0);
+        else
+            d->inspector->setPage(0);
+    }
     delete d;
 }
 
index 5077030fa20a66694cfa6c2e232048eccc5b4fd8..7be049de7aa8a79dda64c8b9002b3c5df50ca292 100644 (file)
@@ -1,3 +1,13 @@
+2009-11-19  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Fix QWebInspector destruction problem.
+        https://bugs.webkit.org/show_bug.cgi?id=31664
+
+        * Api/qwebpage.cpp:
+        (QWebPage::~QWebPage):
+
 2009-11-19  Olivier Goffart  <ogoffart@trolltech.com>
 
         Reviewed by Simon Hausmann.