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

darin darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:11:07 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 9e83b7609e69330d565301e0c1697ed6c4781c9a
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Dec 4 04:39:59 2002 +0000

    	- fixed 3117135 -- world leak: drag any image, get a leak of 1 WebFrame
    
            Reviewed by John.
    
            * WebView.subproj/WebHTMLView.m:
            (-[WebHTMLView mouseDragged:]): Retain the URL of the dragged image, not the entire
    	element dictionary. The element dictionary creates a reference cycle since it includes
    	a reference to the WebFrame.
            (-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]): Use the URL rather than
    	extracting it from the dictionary with a WebElementImageURLKey.
    
            * WebView.subproj/WebHTMLViewPrivate.h: URL, not element dictionary.
            * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLViewPrivate dealloc]): Release the
    	URL, not the element dictionary.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2921 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 55e56e0..23a2378 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,20 @@
+2002-12-03  Darin Adler  <darin at apple.com>
+
+	- fixed 3117135 -- world leak: drag any image, get a leak of 1 WebFrame
+
+        Reviewed by John.
+
+        * WebView.subproj/WebHTMLView.m:
+        (-[WebHTMLView mouseDragged:]): Retain the URL of the dragged image, not the entire
+	element dictionary. The element dictionary creates a reference cycle since it includes
+	a reference to the WebFrame.
+        (-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]): Use the URL rather than
+	extracting it from the dictionary with a WebElementImageURLKey.
+
+        * WebView.subproj/WebHTMLViewPrivate.h: URL, not element dictionary.
+        * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLViewPrivate dealloc]): Release the
+	URL, not the element dictionary.
+
 2002-12-03  Richard Williamson   <rjw at apple.com>
 
         Added a preference to change the page cache size, i.e.:
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 55e56e0..23a2378 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,20 @@
+2002-12-03  Darin Adler  <darin at apple.com>
+
+	- fixed 3117135 -- world leak: drag any image, get a leak of 1 WebFrame
+
+        Reviewed by John.
+
+        * WebView.subproj/WebHTMLView.m:
+        (-[WebHTMLView mouseDragged:]): Retain the URL of the dragged image, not the entire
+	element dictionary. The element dictionary creates a reference cycle since it includes
+	a reference to the WebFrame.
+        (-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]): Use the URL rather than
+	extracting it from the dictionary with a WebElementImageURLKey.
+
+        * WebView.subproj/WebHTMLViewPrivate.h: URL, not element dictionary.
+        * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLViewPrivate dealloc]): Release the
+	URL, not the element dictionary.
+
 2002-12-03  Richard Williamson   <rjw at apple.com>
 
         Added a preference to change the page cache size, i.e.:
diff --git a/WebKit/WebView.subproj/WebHTMLView.m b/WebKit/WebView.subproj/WebHTMLView.m
index e9446fa..3271d99 100644
--- a/WebKit/WebView.subproj/WebHTMLView.m
+++ b/WebKit/WebView.subproj/WebHTMLView.m
@@ -641,14 +641,14 @@
     NSURL *linkURL = [element objectForKey: WebElementLinkURLKey];
     NSURL *imageURL = [element objectForKey: WebElementImageURLKey];
 
-    [_private->draggingImageElement release];
-    _private->draggingImageElement = nil;
+    [_private->draggingImageURL release];
+    _private->draggingImageURL = nil;
     
     if ((deltaX >= DragStartXHysteresis || deltaY >= DragStartYHysteresis) && !didScroll){
         if((imageURL && [[WebPreferences standardPreferences] willLoadImagesAutomatically]) || (!imageURL && linkURL)){
             
             if (imageURL){
-                _private->draggingImageElement = [element retain];
+                _private->draggingImageURL = [imageURL retain];
                 
                 [self _web_dragPromisedImage:[element objectForKey:WebElementImageKey]
                                       origin:[[element objectForKey:WebElementImageLocationKey] pointValue]
@@ -780,16 +780,14 @@
 
 - (NSArray *)namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropDestination
 {
-    NSURL *imageURL = [_private->draggingImageElement objectForKey: WebElementImageURLKey];
-    
-    if(!imageURL){
+    if (!_private->draggingImageURL) {
         return nil;
     }
     
-    NSString *filename = [[imageURL path] lastPathComponent];
+    NSString *filename = [[_private->draggingImageURL path] lastPathComponent];
     NSString *path = [[dropDestination path] stringByAppendingPathComponent:filename];
 
-    [[self _controller] _downloadURL:imageURL toPath:path];
+    [[self _controller] _downloadURL:_private->draggingImageURL toPath:path];
     
     return [NSArray arrayWithObject:filename];
 }
diff --git a/WebKit/WebView.subproj/WebHTMLViewPrivate.h b/WebKit/WebView.subproj/WebHTMLViewPrivate.h
index 09461be..9daf761 100644
--- a/WebKit/WebView.subproj/WebHTMLViewPrivate.h
+++ b/WebKit/WebView.subproj/WebHTMLViewPrivate.h
@@ -28,7 +28,7 @@
 
     NSEvent *mouseDownEvent;
 
-    NSDictionary *draggingImageElement;
+    NSURL *draggingImageURL;
     
     NSSize lastLayoutSize;
 }
diff --git a/WebKit/WebView.subproj/WebHTMLViewPrivate.m b/WebKit/WebView.subproj/WebHTMLViewPrivate.m
index e9809fb..1a52bb7 100644
--- a/WebKit/WebView.subproj/WebHTMLViewPrivate.m
+++ b/WebKit/WebView.subproj/WebHTMLViewPrivate.m
@@ -60,7 +60,7 @@
 - (void)dealloc
 {
     [mouseDownEvent release];
-    [draggingImageElement release];
+    [draggingImageURL release];
     [super dealloc];
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list