[SCM] WebKit Debian packaging branch, debian/experimental, updated. debian/1.3.8-1-1049-g2e11a8e

benjamin.poulain at nokia.com benjamin.poulain at nokia.com
Fri Jan 21 15:12:01 UTC 2011


The following commit has been merged in the debian/experimental branch:
commit 58769603d3ab0f0df9813488a7634da08817a5e5
Author: benjamin.poulain at nokia.com <benjamin.poulain at nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sun Jan 9 02:29:30 2011 +0000

    2011-01-08  Benjamin Poulain  <benjamin.poulain at nokia.com>
    
            Reviewed by Kenneth Rohde Christiansen.
    
            [Qt] QtWebKit crashes when using XMLHttpRequest from the unload event
            https://bugs.webkit.org/show_bug.cgi?id=51934
    
            When accessing the network from the destructor of QWebPage, the network access manager
            was already deleted because the object WebPage was already destructed.
    
            This solve the problem by linking the lifetime of the network access manager to WebPage's QObject.
            The object is now destructed in the destructor of QObject.
    
            * QtTestBrowser/webpage.cpp:
            (WebPage::WebPage):
            (WebPage::setQnamThreaded):
            * QtTestBrowser/webpage.h:
            (QtNAMThread::QtNAMThread):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75340 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/Tools/ChangeLog b/Tools/ChangeLog
index 0fc4949..9d87917 100644
--- a/Tools/ChangeLog
+++ b/Tools/ChangeLog
@@ -1,3 +1,22 @@
+2011-01-08  Benjamin Poulain  <benjamin.poulain at nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] QtWebKit crashes when using XMLHttpRequest from the unload event
+        https://bugs.webkit.org/show_bug.cgi?id=51934
+
+        When accessing the network from the destructor of QWebPage, the network access manager
+        was already deleted because the object WebPage was already destructed.
+
+        This solve the problem by linking the lifetime of the network access manager to WebPage's QObject.
+        The object is now destructed in the destructor of QObject.
+
+        * QtTestBrowser/webpage.cpp:
+        (WebPage::WebPage):
+        (WebPage::setQnamThreaded):
+        * QtTestBrowser/webpage.h:
+        (QtNAMThread::QtNAMThread):
+
 2011-01-08  Eric Seidel  <eric at webkit.org>
 
         Reviewed by Ojan Vafai.
diff --git a/Tools/QtTestBrowser/webpage.cpp b/Tools/QtTestBrowser/webpage.cpp
index 15f6db0..9e0c49e 100644
--- a/Tools/QtTestBrowser/webpage.cpp
+++ b/Tools/QtTestBrowser/webpage.cpp
@@ -45,6 +45,7 @@ WebPage::WebPage(QObject* parent)
     : QWebPage(parent)
     , m_userAgent()
     , m_interruptingJavaScriptEnabled(false)
+    , m_qnamThread(0)
 {
     applyProxy();
 
@@ -126,12 +127,14 @@ void WebPage::setQnamThreaded(bool threaded)
         return;
 
     if (threaded) {
-        m_qnamThread.reset(new QtNAMThread);
+        if (!m_qnamThread)
+            m_qnamThread = new QtNAMThread(this);
         m_qnamThread->start();
         setNetworkAccessManager(m_qnamThread->networkAccessManager());
     } else {
         setNetworkAccessManager(0);
-        m_qnamThread.reset();
+        delete m_qnamThread;
+        m_qnamThread = 0;
     }
 
     Qt::ConnectionType connectionType = threaded ? Qt::BlockingQueuedConnection : Qt::DirectConnection;
diff --git a/Tools/QtTestBrowser/webpage.h b/Tools/QtTestBrowser/webpage.h
index e62402b..fa93bab 100644
--- a/Tools/QtTestBrowser/webpage.h
+++ b/Tools/QtTestBrowser/webpage.h
@@ -70,13 +70,14 @@ private:
     void applyProxy();
     QString m_userAgent;
     bool m_interruptingJavaScriptEnabled;
-    QScopedPointer<QtNAMThread> m_qnamThread;
+    QtNAMThread* m_qnamThread;
 };
 
 
 class QtNAMThread : public QThread {
 public:
-    QtNAMThread()
+    QtNAMThread(QObject *parent = 0)
+        : QThread(parent)
     {
         m_qnamFuture.reportStarted();
     }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list