[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

cblu cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:22:57 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 1456c5de74e99c8afbff3ea332abd613966af6a0
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Jan 30 22:11:02 2003 +0000

    	Fixed: 3161102 - Avoid retain cycles by destroying plug-ins in the page cache before dealloc
    
            Reviewed by rjw.
    
            * History.subproj/WebHistoryItem.m:
            (+[WebHistoryItem _releaseAllPendingPageCaches]): iterate over all of the plug-ins and call destroy
            * WebView.subproj/WebHTMLView.m:
            (-[WebHTMLView windowWillClose:]): clear page cache
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3512 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index d8e6cd8..625730b 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,5 +1,16 @@
 2003-01-30  Chris Blumenberg  <cblu at apple.com>
 
+	Fixed: 3161102 - Avoid retain cycles by destroying plug-ins in the page cache before dealloc
+
+        Reviewed by rjw.
+
+        * History.subproj/WebHistoryItem.m:
+        (+[WebHistoryItem _releaseAllPendingPageCaches]): iterate over all of the plug-ins and call destroy
+        * WebView.subproj/WebHTMLView.m:
+        (-[WebHTMLView windowWillClose:]): clear page cache
+
+2003-01-30  Chris Blumenberg  <cblu at apple.com>
+
 	Fixed: 3160464 - Slideback sometimes happens twice
 
 	Because we start drags in mouseDragged (which AppKit says we shouldn't), we get mouseDragged events after a drag (image, link, text etc) has ended. We also get mouseDragged events after we've sent the fake mouseUp to WebCore. That is probably bad for unknown reasons.
diff --git a/WebKit/History.subproj/WebHistoryItem.m b/WebKit/History.subproj/WebHistoryItem.m
index 8bfe522..92baf13 100644
--- a/WebKit/History.subproj/WebHistoryItem.m
+++ b/WebKit/History.subproj/WebHistoryItem.m
@@ -6,9 +6,11 @@
 #import <WebKit/WebHistoryItemPrivate.h>
 
 #import <WebKit/WebFramePrivate.h>
+#import <WebKit/WebHTMLViewPrivate.h>
 #import <WebKit/WebIconDatabase.h>
 #import <WebKit/WebIconLoader.h>
 #import <WebKit/WebKitLogging.h>
+#import <WebKit/WebPluginController.h>
 
 #import <WebFoundation/WebAssertions.h>
 #import <WebFoundation/WebNSDictionaryExtras.h>
@@ -504,6 +506,20 @@ static NSTimer *_pageCacheReleaseTimer = nil;
 {
     LOG (PageCache, "releasing %d items\n", [_pendingPageCacheToRelease count]);
     [WebHistoryItem _invalidateReleaseTimer];
+
+    NSEnumerator *enumerator = [_pendingPageCacheToRelease objectEnumerator];
+    NSDictionary *cache;
+
+    // Plug-ins could retain anything including the WebHTMLView or the window.
+    // To avoid any possible retain cycle, call destroyPlugin on all the plug-ins
+    // instead of completely relying on dealloc.
+    while ((cache = [enumerator nextObject]) != nil) {
+        WebHTMLView *view = [cache objectForKey:@"WebKitDocumentView"];
+        if ([view isKindOfClass:[WebHTMLView class]]) {
+            [[view _pluginController] destroyAllPlugins];
+        }
+    }
+    
     [_pendingPageCacheToRelease removeAllObjects];
 }
 
diff --git a/WebKit/WebView.subproj/WebHTMLView.m b/WebKit/WebView.subproj/WebHTMLView.m
index acf5242..29e8d40 100644
--- a/WebKit/WebView.subproj/WebHTMLView.m
+++ b/WebKit/WebView.subproj/WebHTMLView.m
@@ -5,6 +5,7 @@
 
 #import <WebKit/WebHTMLView.h>
 
+#import <WebKit/WebBackForwardList.h>
 #import <WebKit/WebBridge.h>
 #import <WebKit/WebClipView.h>
 #import <WebKit/WebContextMenuDelegate.h>
@@ -597,7 +598,11 @@
 }
 
 - (void)windowWillClose:(NSNotification *)notification
-{	
+{
+    // Plug-ins could retain anything including the WebHTMLView or the window.
+    // To avoid any possible retain cycle, call destroyPlugin on all the plug-ins
+    // including the ones in the page cache instead of completely relying on dealloc.
+    [[[self _controller] backForwardList] clearPageCache];
     [[self _pluginController] destroyAllPlugins];
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list