[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198

kbalazs at webkit.org kbalazs at webkit.org
Sun Feb 20 23:05:56 UTC 2011


The following commit has been merged in the webkit-1.3 branch:
commit b4f4fb335e0013056546045022dd611a1e020412
Author: kbalazs at webkit.org <kbalazs at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Jan 17 13:28:53 2011 +0000

    2011-01-17  Balazs Kelemen  <kbalazs at webkit.org>
    
            Reviewed by Andreas Kling.
    
            [Qt][WK2] Crash due to double destruction of QSharedMemory
            https://bugs.webkit.org/show_bug.cgi?id=52569
    
            Avoid deleting the QSharedMemory twice.
            * Platform/qt/SharedMemoryQt.cpp:
            (WebKit::SharedMemory::~SharedMemory):
            * Shared/qt/CleanupHandler.cpp:
            Renamed m_inDeleteObjects to m_hasStartedDeleting and
            added a getter for it.
            (WebKit::CleanupHandler::CleanupHandler):
            (WebKit::CleanupHandler::deleteObjects):
            * Shared/qt/CleanupHandler.h:
            (WebKit::CleanupHandler::unmark):
            (WebKit::CleanupHandler::hasStartedDeleting):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75935 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog
index 83c0829..ef94588 100644
--- a/Source/WebKit2/ChangeLog
+++ b/Source/WebKit2/ChangeLog
@@ -1,3 +1,22 @@
+2011-01-17  Balazs Kelemen  <kbalazs at webkit.org>
+
+        Reviewed by Andreas Kling.
+
+        [Qt][WK2] Crash due to double destruction of QSharedMemory
+        https://bugs.webkit.org/show_bug.cgi?id=52569
+
+        Avoid deleting the QSharedMemory twice.
+        * Platform/qt/SharedMemoryQt.cpp:
+        (WebKit::SharedMemory::~SharedMemory):
+        * Shared/qt/CleanupHandler.cpp:
+        Renamed m_inDeleteObjects to m_hasStartedDeleting and
+        added a getter for it.
+        (WebKit::CleanupHandler::CleanupHandler):
+        (WebKit::CleanupHandler::deleteObjects):
+        * Shared/qt/CleanupHandler.h:
+        (WebKit::CleanupHandler::unmark):
+        (WebKit::CleanupHandler::hasStartedDeleting):
+
 2011-01-15  Adam Barth  <abarth at webkit.org>
 
         Rubber-stamped by Eric Seidel.
diff --git a/Source/WebKit2/Platform/qt/SharedMemoryQt.cpp b/Source/WebKit2/Platform/qt/SharedMemoryQt.cpp
index 08f5695..f5fecfc 100644
--- a/Source/WebKit2/Platform/qt/SharedMemoryQt.cpp
+++ b/Source/WebKit2/Platform/qt/SharedMemoryQt.cpp
@@ -144,6 +144,9 @@ PassRefPtr<SharedMemory> SharedMemory::create(const Handle& handle, Protection p
 
 SharedMemory::~SharedMemory()
 {
+    if (CleanupHandler::instance()->hasStartedDeleting())
+        return;
+
     CleanupHandler::instance()->unmark(m_impl);
     delete m_impl;
 }
diff --git a/Source/WebKit2/Shared/qt/CleanupHandler.cpp b/Source/WebKit2/Shared/qt/CleanupHandler.cpp
index c033cba..74c1d4c 100644
--- a/Source/WebKit2/Shared/qt/CleanupHandler.cpp
+++ b/Source/WebKit2/Shared/qt/CleanupHandler.cpp
@@ -36,7 +36,7 @@ namespace WebKit {
 CleanupHandler* CleanupHandler::theInstance = 0;
 
 CleanupHandler::CleanupHandler()
-    : m_inDeleteObjects(false)
+    : m_hasStartedDeleting(false)
 {
     moveToThread(qApp->thread()); // Ensure that we are acting on the main thread.
     connect(qApp, SIGNAL(aboutToQuit()), SLOT(deleteObjects()), Qt::DirectConnection);
@@ -50,7 +50,7 @@ void CleanupHandler::sigTermHandler(int)
 
 void CleanupHandler::deleteObjects()
 {
-    m_inDeleteObjects = true;
+    m_hasStartedDeleting = true;
     for (unsigned i = 0; i < m_objects.size(); ++i)
         m_objects[i]->deleteLater();
 }
diff --git a/Source/WebKit2/Shared/qt/CleanupHandler.h b/Source/WebKit2/Shared/qt/CleanupHandler.h
index ca94a5c..afd7723 100644
--- a/Source/WebKit2/Shared/qt/CleanupHandler.h
+++ b/Source/WebKit2/Shared/qt/CleanupHandler.h
@@ -51,11 +51,13 @@ public:
 
     void unmark(QObject* object)
     {
-        if (m_inDeleteObjects)
+        if (m_hasStartedDeleting)
             return;
         m_objects.removeOne(object);
     }
 
+    bool hasStartedDeleting() const { return m_hasStartedDeleting; }
+
 private slots:
     void deleteObjects();
 
@@ -66,7 +68,7 @@ private:
     CleanupHandler();
 
     QList<QObject*> m_objects;
-    bool m_inDeleteObjects;
+    bool m_hasStartedDeleting;
 };
 
 } // namespace WebKit

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list