[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

aroben at apple.com aroben at apple.com
Thu Apr 8 00:55:04 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit da36404ea0db03b14d130f5ef52e98331598cf40
Author: aroben at apple.com <aroben at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jan 5 23:07:08 2010 +0000

    Add assertions to catch double-destruction of WebViews earlier
    
    I basically copied the m_deletionHasBegun logic from WTF::RefCounted.
    
    Fixes <http://webkit.org/b/33219>.
    
    Reviewed by Darin Adler.
    
    * WebView.cpp:
    (WebView::WebView): Initialize m_deletionHasBegun
    (WebView::AddRef): Assert that deletion hasn't already begun.
    (WebView::Release): Assert that deletion hasn't already begun, then
    record when deletion *does* begin.
    
    * WebView.h: Added m_deletionHasBegun.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52828 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog
index a238075..af1c1a5 100644
--- a/WebKit/win/ChangeLog
+++ b/WebKit/win/ChangeLog
@@ -1,5 +1,23 @@
 2010-01-05  Adam Roben  <aroben at apple.com>
 
+        Add assertions to catch double-destruction of WebViews earlier
+
+        I basically copied the m_deletionHasBegun logic from WTF::RefCounted.
+
+        Fixes <http://webkit.org/b/33219>.
+
+        Reviewed by Darin Adler.
+
+        * WebView.cpp:
+        (WebView::WebView): Initialize m_deletionHasBegun
+        (WebView::AddRef): Assert that deletion hasn't already begun.
+        (WebView::Release): Assert that deletion hasn't already begun, then
+        record when deletion *does* begin.
+
+        * WebView.h: Added m_deletionHasBegun.
+
+2010-01-05  Adam Roben  <aroben at apple.com>
+
         Remove dead code in WebViewWndProc
 
         Fixes <http://webkit.org/b/33218>.
@@ -72,6 +90,7 @@
 
         * WebView.h: onIMERequest functions now return result directly.
 
+
 2010-01-04  Adam Roben  <aroben at apple.com>
 
         Add WebKitAPITest
diff --git a/WebKit/win/WebView.cpp b/WebKit/win/WebView.cpp
index bb8c2f1..c5d59c0 100644
--- a/WebKit/win/WebView.cpp
+++ b/WebKit/win/WebView.cpp
@@ -296,6 +296,9 @@ bool WebView::s_allowSiteSpecificHacks = false;
 
 WebView::WebView()
     : m_refCount(0)
+#if !ASSERT_DISABLED
+    , m_deletionHasBegun(false)
+#endif
     , m_hostWindow(0)
     , m_viewWindow(0)
     , m_mainFrame(0)
@@ -2267,14 +2270,21 @@ HRESULT STDMETHODCALLTYPE WebView::QueryInterface(REFIID riid, void** ppvObject)
 
 ULONG STDMETHODCALLTYPE WebView::AddRef(void)
 {
+    ASSERT(!m_deletionHasBegun);
     return ++m_refCount;
 }
 
 ULONG STDMETHODCALLTYPE WebView::Release(void)
 {
+    ASSERT(!m_deletionHasBegun);
+
     ULONG newRef = --m_refCount;
-    if (!newRef)
+    if (!newRef) {
+#if !ASSERT_DISABLED
+        m_deletionHasBegun = true;
+#endif
         delete(this);
+    }
 
     return newRef;
 }
diff --git a/WebKit/win/WebView.h b/WebKit/win/WebView.h
index 7b27293..9522ed3 100644
--- a/WebKit/win/WebView.h
+++ b/WebKit/win/WebView.h
@@ -915,6 +915,9 @@ protected:
     virtual void windowReceivedMessage(HWND, UINT message, WPARAM, LPARAM);
 
     ULONG m_refCount;
+#if !ASSERT_DISABLED
+    bool m_deletionHasBegun;
+#endif
     HWND m_hostWindow;
     HWND m_viewWindow;
     WebFrame* m_mainFrame;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list