[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 06:25:38 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 98b784f82521b752e25538d15222e0ebae0a63f3
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Jul 20 21:12:55 2002 +0000

    	- fixed 2999616 -- Possible leak in +[IFPluginDatabase installedPlugins]
    
            * Plugins.subproj/WebPluginDatabase.m:
            (+[WebPluginDatabase installedPlugins]): Move the code into an init function.
            (pluginLocations): Simplified.
            (-[WebPluginDatabase init]): Added. Cleaned up a bit, and made it release the
    	WebPlugin objects -- this was the leak.
            (-[WebPluginDatabase dealloc]): Added.
    
            * Plugins.subproj/WebPluginDatabase.h: Tweaked formatting.
    
            * Plugins.subproj/WebPluginStream.h:
            * Plugins.subproj/WebPluginStream.m:
            (-[WebPluginStream startLoad]):
            (-[WebPluginStream stop]):
            * WebCoreSupport.subproj/WebSubresourceClient.m:
            (+[WebSubresourceClient startLoadingResource:withURL:dataSource:]):
            (-[WebSubresourceClient WebResourceHandleDidCancelLoading:]):
            (-[WebSubresourceClient WebResourceHandleDidFinishLoading:data:]):
            (-[WebSubresourceClient WebResourceHandle:didFailLoadingWithResult:]):
            * WebView.subproj/WebDataSource.m:
            (-[WebDataSource stopLoading]):
            * WebView.subproj/WebDataSourcePrivate.h:
            * WebView.subproj/WebDataSourcePrivate.m:
            (-[WebDataSourcePrivate dealloc]):
            (-[WebDataSource _setPrimaryLoadComplete:]):
            (-[WebDataSource _startLoading:]):
            (-[WebDataSource _addResourceHandle:]):
            (-[WebDataSource _removeResourceHandle:]):
    	Changed code that called it a URLHandle to say resourceHandle.
    
            * WebView.subproj/WebFrame.m: (-[WebFrame dealloc]): Add an autorelease pool here since
    	this is called from a timer and AppKit does not use an explicit autorelease pool
    	in that case. This makes the "world leak check" work better, and is mildly helpful
    	in other cases too. Radar 3003650 is a request for the AppKit team to fix this, but
    	this workaround will do for now.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1605 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 7c316e2..facc248 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,42 @@
+2002-07-20  Darin Adler  <darin at apple.com>
+
+	- fixed 2999616 -- Possible leak in +[IFPluginDatabase installedPlugins]
+
+        * Plugins.subproj/WebPluginDatabase.m:
+        (+[WebPluginDatabase installedPlugins]): Move the code into an init function.
+        (pluginLocations): Simplified.
+        (-[WebPluginDatabase init]): Added. Cleaned up a bit, and made it release the
+	WebPlugin objects -- this was the leak.
+        (-[WebPluginDatabase dealloc]): Added.
+
+        * Plugins.subproj/WebPluginDatabase.h: Tweaked formatting.
+
+        * Plugins.subproj/WebPluginStream.h:
+        * Plugins.subproj/WebPluginStream.m:
+        (-[WebPluginStream startLoad]):
+        (-[WebPluginStream stop]):
+        * WebCoreSupport.subproj/WebSubresourceClient.m:
+        (+[WebSubresourceClient startLoadingResource:withURL:dataSource:]):
+        (-[WebSubresourceClient WebResourceHandleDidCancelLoading:]):
+        (-[WebSubresourceClient WebResourceHandleDidFinishLoading:data:]):
+        (-[WebSubresourceClient WebResourceHandle:didFailLoadingWithResult:]):
+        * WebView.subproj/WebDataSource.m:
+        (-[WebDataSource stopLoading]):
+        * WebView.subproj/WebDataSourcePrivate.h:
+        * WebView.subproj/WebDataSourcePrivate.m:
+        (-[WebDataSourcePrivate dealloc]):
+        (-[WebDataSource _setPrimaryLoadComplete:]):
+        (-[WebDataSource _startLoading:]):
+        (-[WebDataSource _addResourceHandle:]):
+        (-[WebDataSource _removeResourceHandle:]):
+	Changed code that called it a URLHandle to say resourceHandle.
+
+        * WebView.subproj/WebFrame.m: (-[WebFrame dealloc]): Add an autorelease pool here since
+	this is called from a timer and AppKit does not use an explicit autorelease pool
+	in that case. This makes the "world leak check" work better, and is mildly helpful
+	in other cases too. Radar 3003650 is a request for the AppKit team to fix this, but
+	this workaround will do for now.
+
 2002-07-19  Darin Adler  <darin at apple.com>
 
 	- fixed 3001951 -- Massive memory leak after running base or static PLT
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 7c316e2..facc248 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,42 @@
+2002-07-20  Darin Adler  <darin at apple.com>
+
+	- fixed 2999616 -- Possible leak in +[IFPluginDatabase installedPlugins]
+
+        * Plugins.subproj/WebPluginDatabase.m:
+        (+[WebPluginDatabase installedPlugins]): Move the code into an init function.
+        (pluginLocations): Simplified.
+        (-[WebPluginDatabase init]): Added. Cleaned up a bit, and made it release the
+	WebPlugin objects -- this was the leak.
+        (-[WebPluginDatabase dealloc]): Added.
+
+        * Plugins.subproj/WebPluginDatabase.h: Tweaked formatting.
+
+        * Plugins.subproj/WebPluginStream.h:
+        * Plugins.subproj/WebPluginStream.m:
+        (-[WebPluginStream startLoad]):
+        (-[WebPluginStream stop]):
+        * WebCoreSupport.subproj/WebSubresourceClient.m:
+        (+[WebSubresourceClient startLoadingResource:withURL:dataSource:]):
+        (-[WebSubresourceClient WebResourceHandleDidCancelLoading:]):
+        (-[WebSubresourceClient WebResourceHandleDidFinishLoading:data:]):
+        (-[WebSubresourceClient WebResourceHandle:didFailLoadingWithResult:]):
+        * WebView.subproj/WebDataSource.m:
+        (-[WebDataSource stopLoading]):
+        * WebView.subproj/WebDataSourcePrivate.h:
+        * WebView.subproj/WebDataSourcePrivate.m:
+        (-[WebDataSourcePrivate dealloc]):
+        (-[WebDataSource _setPrimaryLoadComplete:]):
+        (-[WebDataSource _startLoading:]):
+        (-[WebDataSource _addResourceHandle:]):
+        (-[WebDataSource _removeResourceHandle:]):
+	Changed code that called it a URLHandle to say resourceHandle.
+
+        * WebView.subproj/WebFrame.m: (-[WebFrame dealloc]): Add an autorelease pool here since
+	this is called from a timer and AppKit does not use an explicit autorelease pool
+	in that case. This makes the "world leak check" work better, and is mildly helpful
+	in other cases too. Radar 3003650 is a request for the AppKit team to fix this, but
+	this workaround will do for now.
+
 2002-07-19  Darin Adler  <darin at apple.com>
 
 	- fixed 3001951 -- Massive memory leak after running base or static PLT
diff --git a/WebKit/Plugins.subproj/WebPluginDatabase.h b/WebKit/Plugins.subproj/WebPluginDatabase.h
index 50f277d..98217d3 100644
--- a/WebKit/Plugins.subproj/WebPluginDatabase.h
+++ b/WebKit/Plugins.subproj/WebPluginDatabase.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2001, 2002 Apple Computer, Inc.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -27,7 +27,8 @@
 
 @class WebPlugin;
 
- at interface WebPluginDatabase : NSObject {
+ at interface WebPluginDatabase : NSObject
+{
     NSArray *plugins;
 }
 
@@ -35,7 +36,7 @@
 - (WebPlugin *)pluginForMimeType:(NSString *)mimeType;
 - (WebPlugin *)pluginForExtension:(NSString *)extension;
 - (WebPlugin *)pluginWithFilename:(NSString *)filename;
-- (NSArray *) MIMETypes;
-- (NSArray *) plugins;
+- (NSArray *)MIMETypes;
+- (NSArray *)plugins;
 
- at end
\ No newline at end of file
+ at end
diff --git a/WebKit/Plugins.subproj/WebPluginDatabase.m b/WebKit/Plugins.subproj/WebPluginDatabase.m
index 401369b..ddbe656 100644
--- a/WebKit/Plugins.subproj/WebPluginDatabase.m
+++ b/WebKit/Plugins.subproj/WebPluginDatabase.m
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2001, 2002 Apple Computer, Inc.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -23,41 +23,28 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
+#import <WebKit/WebPluginDatabase.h>
+
 #import <WebKit/WebPlugin.h>
 #import <WebKit/WebPluginStream.h>
 #import <WebKit/WebPluginView.h>
-#import <WebKit/WebPluginDatabase.h>
 #import <WebKit/WebView.h>
 #import <WebKit/WebDataSource.h>
 #import <WebKit/WebKitDebug.h>
 
-NSArray *_pluginLocations(void);
-NSArray *_findPlugins(void);
-
 @implementation WebPluginDatabase
-static WebPluginDatabase *__IFPluginDatabase = nil;
 
+static WebPluginDatabase *database = nil;
 
 + (WebPluginDatabase *)installedPlugins 
 {
-    if(!__IFPluginDatabase){
-        __IFPluginDatabase  = [WebPluginDatabase alloc];
-        __IFPluginDatabase->plugins = _findPlugins();
-        
-        // register plug-in WebDocumentViews and WebDocumentRepresentations
-        NSArray *mimes = [__IFPluginDatabase MIMETypes];
-        NSString *mime;
-        unsigned i;
-        
-        for(i=0; i<[mimes count]; i++){
-            mime = [mimes objectAtIndex:i];
-            [WebView registerViewClass:[WebPluginView class] forMIMEType:mime];
-            [WebDataSource registerRepresentationClass:[WebPluginStream class] forMIMEType:mime];
-        }
+    if (!database) {
+        database = [[WebPluginDatabase alloc] init];
     }
-    return __IFPluginDatabase;
+    return database;
 }
 
+// FIXME: Use a dictionary for this?
 // The first plugin with the specified mime type is returned. We may want to tie this to the defaults so that this is configurable.
 - (WebPlugin *)pluginForMimeType:(NSString *)mimeType
 {
@@ -77,6 +64,7 @@ static WebPluginDatabase *__IFPluginDatabase = nil;
     return nil;
 }
 
+// FIXME: Use a dictionary for this?
 - (WebPlugin *)pluginForExtension:(NSString *)extension
 {
     uint i, n;
@@ -97,6 +85,7 @@ static WebPluginDatabase *__IFPluginDatabase = nil;
     return nil;
 }
 
+// FIXME: Use a dictionary for this?
 - (WebPlugin *)pluginWithFilename:(NSString *)filename
 {
     uint i;
@@ -111,12 +100,13 @@ static WebPluginDatabase *__IFPluginDatabase = nil;
     return nil;
 }
 
-- (NSArray *) plugins
+- (NSArray *)plugins
 {
     return plugins;
 }
 
-- (NSArray *) MIMETypes
+// FIXME: Maybe a set rather than an array?
+- (NSArray *)MIMETypes
 {
     NSMutableArray *allHandledMIMETypes;
     WebPlugin *plugin;
@@ -134,48 +124,48 @@ static WebPluginDatabase *__IFPluginDatabase = nil;
     return allHandledMIMETypes;
 }
 
- at end
-
-NSArray *_pluginLocations(void)
+static NSArray *pluginLocations(void)
 {
-    NSMutableArray *locations;
-    NSBundle *applicationBundle;
-    
     // Plug-ins are found in order of precedence.
     // If there are duplicates, the first found plug-in is used.
     // For example, if there is a QuickTime.plugin in the users's home directory
     // that is used instead of the /Library/Internet Plug-ins version.
-    // The purpose is to allow non-admin user's to update their plug-ins.
+    // The purpose is to allow non-admin users to update their plug-ins.
     
-    locations = [NSMutableArray arrayWithCapacity:3];
-    [locations addObject:[NSHomeDirectory() stringByAppendingPathComponent:@"Library/Internet Plug-Ins"]];
-    [locations addObject:@"/Library/Internet Plug-Ins"];
-
-    applicationBundle = [NSBundle mainBundle];
-    [locations addObject:[applicationBundle builtInPlugInsPath]];
-    
-    return locations;
+    return [NSArray arrayWithObjects:
+        [NSHomeDirectory() stringByAppendingPathComponent:@"Library/Internet Plug-Ins"],
+    	@"/Library/Internet Plug-Ins",
+    	[[NSBundle mainBundle] builtInPlugInsPath],
+        nil];
 }
 
-NSArray *_findPlugins(void)
+- init
 {
     NSFileManager *fileManager;
     NSArray *pluginDirectories, *files;
     NSString *file;
-    NSMutableArray *pluginPaths, *pluginArray, *filenames;
+    NSMutableArray *pluginPaths, *pluginArray;
+    NSMutableSet *filenames;
     WebPlugin *plugin;
     uint i, n;
     
-    pluginDirectories = _pluginLocations();    
+    self = [super init];
+    if (self == nil) {
+        return nil;
+    }
+    
+    pluginDirectories = pluginLocations();
+    
     fileManager = [NSFileManager defaultManager];
+
     pluginPaths = [NSMutableArray arrayWithCapacity:10];
-    filenames = [NSMutableArray arrayWithCapacity:10];
-    
-    for(i=0; i<[pluginDirectories count]; i++){
+    filenames = [NSMutableSet setWithCapacity:10];
+
+    for (i = 0; i < [pluginDirectories count]; i++) {
         files = [fileManager directoryContentsAtPath:[pluginDirectories objectAtIndex:i]];
-        for(n=0; n<[files count]; n++){
+        for (n = 0; n < [files count]; n++) {
             file = [files objectAtIndex:n];
-            if(![filenames containsObject:file]){ // avoid duplicates
+            if (![filenames containsObject:file]) { // avoid duplicates
                 [filenames addObject:file];
                 [pluginPaths addObject:[[pluginDirectories objectAtIndex:i] stringByAppendingPathComponent:file]];
             }
@@ -184,16 +174,32 @@ NSArray *_findPlugins(void)
     
     pluginArray = [NSMutableArray arrayWithCapacity:[pluginPaths count]];
     
-    for(i=0; i<[pluginPaths count]; i++){
-        plugin = [WebPlugin alloc];
-        if([plugin initWithPath:[pluginPaths objectAtIndex:i]]){
-            [plugin retain];
+    for (i = 0; i < [pluginPaths count]; i++) {
+        plugin = [[WebPlugin alloc] initWithPath:[pluginPaths objectAtIndex:i]];
+        if (plugin) {
             [pluginArray addObject:plugin];
             WEBKITDEBUGLEVEL(WEBKIT_LOG_PLUGINS, "Found plugin: %s\n", [[plugin name] lossyCString]);
             WEBKITDEBUGLEVEL(WEBKIT_LOG_PLUGINS, "%s", [[plugin description] lossyCString]);
+            [plugin release];
         }
     }
-    return [pluginArray retain];
+        
+    // register plug-in WebDocumentViews and WebDocumentRepresentations
+    NSArray *mimes = [database MIMETypes];
+    for (i = 0; i < [mimes count]; i++) {
+        [WebView registerViewClass:[WebPluginView class] forMIMEType:[mimes objectAtIndex:i]];
+        [WebDataSource registerRepresentationClass:[WebPluginStream class] forMIMEType:[mimes objectAtIndex:i]];
+    }
+    
+    plugins = [pluginArray copy];
+
+    return self;
 }
 
+- (void)dealloc
+{
+    [plugins release];
+    [super dealloc];
+}
 
+ at end
diff --git a/WebKit/Plugins.subproj/WebPluginStream.h b/WebKit/Plugins.subproj/WebPluginStream.h
index 8c959f0..ac28da8 100644
--- a/WebKit/Plugins.subproj/WebPluginStream.h
+++ b/WebKit/Plugins.subproj/WebPluginStream.h
@@ -29,7 +29,7 @@
     BOOL isFirstChunk;
     BOOL stopped;
     
-    WebResourceHandle *URLHandle;
+    WebResourceHandle *resource;
     
     NPP_NewStreamProcPtr NPP_NewStream;
     NPP_DestroyStreamProcPtr NPP_DestroyStream;
diff --git a/WebKit/Plugins.subproj/WebPluginStream.m b/WebKit/Plugins.subproj/WebPluginStream.m
index 1ae6ae8..1639ab3 100644
--- a/WebKit/Plugins.subproj/WebPluginStream.m
+++ b/WebKit/Plugins.subproj/WebPluginStream.m
@@ -85,10 +85,10 @@ static NSString *getCarbonPath(NSString *posixPath);
 
 - (void)startLoad
 {
-    URLHandle = [[WebResourceHandle alloc] initWithURL:URL attributes:attributes flags:0];
-    if(URLHandle){
-        [URLHandle addClient:self];
-        [URLHandle loadInBackground];
+    resource = [[WebResourceHandle alloc] initWithURL:URL attributes:attributes flags:0];
+    if(resource){
+        [resource addClient:self];
+        [resource loadInBackground];
     }
 }
 
@@ -96,10 +96,10 @@ static NSString *getCarbonPath(NSString *posixPath);
 {
     if(!stopped){
         stopped = YES;
-        if([URLHandle statusCode] == WebResourceHandleStatusLoading)
-            [URLHandle cancelLoadInBackground];
-        [URLHandle removeClient:self];
-        [URLHandle release];
+        if([resource statusCode] == WebResourceHandleStatusLoading)
+            [resource cancelLoadInBackground];
+        [resource removeClient:self];
+        [resource release];
     }
     [view release];
     view = nil;
diff --git a/WebKit/WebCoreSupport.subproj/WebSubresourceClient.m b/WebKit/WebCoreSupport.subproj/WebSubresourceClient.m
index aa3a5d4..01bbfa1 100644
--- a/WebKit/WebCoreSupport.subproj/WebSubresourceClient.m
+++ b/WebKit/WebCoreSupport.subproj/WebSubresourceClient.m
@@ -73,7 +73,7 @@
         [[source controller] _receivedError:badURLError forResourceHandle:nil
             partialProgress:nil fromDataSource:source];
     } else {
-        [source _addURLHandle:handle];
+        [source _addResourceHandle:handle];
         
         client = [[self alloc] initWithLoader:rLoader dataSource:source];
         [handle addClient:client];
@@ -117,7 +117,7 @@
     
     [loader cancel];
     
-    [dataSource _removeURLHandle:handle];
+    [dataSource _removeResourceHandle:handle];
         
     error = [[WebError alloc] initWithErrorCode:WebResultCancelled 
         inDomain:WebErrorDomainWebFoundation failingURL:[dataSource inputURL]];
@@ -135,7 +135,7 @@
 
     [loader finish];
     
-    [dataSource _removeURLHandle:handle];
+    [dataSource _removeResourceHandle:handle];
     
     WebError *nonTerminalError = [handle error];
     if (nonTerminalError) {
@@ -153,7 +153,7 @@
 
     [loader cancel];
     
-    [dataSource _removeURLHandle:handle];
+    [dataSource _removeResourceHandle:handle];
     
     [self receivedError:error forHandle:handle];
 
diff --git a/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.m b/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.m
index aa3a5d4..01bbfa1 100644
--- a/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.m
+++ b/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.m
@@ -73,7 +73,7 @@
         [[source controller] _receivedError:badURLError forResourceHandle:nil
             partialProgress:nil fromDataSource:source];
     } else {
-        [source _addURLHandle:handle];
+        [source _addResourceHandle:handle];
         
         client = [[self alloc] initWithLoader:rLoader dataSource:source];
         [handle addClient:client];
@@ -117,7 +117,7 @@
     
     [loader cancel];
     
-    [dataSource _removeURLHandle:handle];
+    [dataSource _removeResourceHandle:handle];
         
     error = [[WebError alloc] initWithErrorCode:WebResultCancelled 
         inDomain:WebErrorDomainWebFoundation failingURL:[dataSource inputURL]];
@@ -135,7 +135,7 @@
 
     [loader finish];
     
-    [dataSource _removeURLHandle:handle];
+    [dataSource _removeResourceHandle:handle];
     
     WebError *nonTerminalError = [handle error];
     if (nonTerminalError) {
@@ -153,7 +153,7 @@
 
     [loader cancel];
     
-    [dataSource _removeURLHandle:handle];
+    [dataSource _removeResourceHandle:handle];
     
     [self receivedError:error forHandle:handle];
 
diff --git a/WebKit/WebView.subproj/WebDataSource.m b/WebKit/WebView.subproj/WebDataSource.m
index d75a618..2e01789 100644
--- a/WebKit/WebView.subproj/WebDataSource.m
+++ b/WebKit/WebView.subproj/WebDataSource.m
@@ -205,7 +205,7 @@
 {
     // stop download here because we can't rely on WebResourceHandleDidCancelLoading
     // as it isn't sent when the app quits
-    [[_private->mainURLHandleClient downloadHandler] cancel];
+    [[_private->mainResourceHandleClient downloadHandler] cancel];
     [self _recursiveStopLoading];
 }
 
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.h b/WebKit/WebView.subproj/WebDataSourcePrivate.h
index 8f6e31f..09af645 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.h
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.h
@@ -41,7 +41,7 @@
 
     // The handle client for the main document associated with the
     // datasource.
-    WebMainResourceClient *mainURLHandleClient;
+    WebMainResourceClient *mainResourceHandleClient;
     
     // Active WebResourceHandles for resources associated with the
     // datasource.
@@ -87,8 +87,8 @@
 - (void)_stopLoading;
 - (BOOL)_isStopping;
 - (void)_recursiveStopLoading;
-- (void)_addURLHandle: (WebResourceHandle *)handle;
-- (void)_removeURLHandle: (WebResourceHandle *)handle;
+- (void)_addResourceHandle: (WebResourceHandle *)handle;
+- (void)_removeResourceHandle: (WebResourceHandle *)handle;
 - (void)_setPrimaryLoadComplete: (BOOL)flag;
 - (double)_loadingStartedTime;
 - (void)_setTitle: (NSString *)title;
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.m b/WebKit/WebView.subproj/WebDataSourcePrivate.m
index 8484a7c..8342871 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.m
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.m
@@ -64,7 +64,7 @@
     [finalURL release];
     [frames release];
     [mainHandle release];
-    [mainURLHandleClient release];
+    [mainResourceHandleClient release];
     [urlHandles release];
     [pageTitle release];
     [downloadPath release];
@@ -160,8 +160,8 @@
     
     if (flag) {
         [self _loadPageIconIfNecessary];
-        [_private->mainURLHandleClient release];
-        _private->mainURLHandleClient = 0; 
+        [_private->mainResourceHandleClient release];
+        _private->mainResourceHandleClient = 0; 
         [_private->mainHandle release];
         _private->mainHandle = 0;
         [self _updateLoading];
@@ -179,8 +179,8 @@
     
     [self _clearErrors];
     
-    _private->mainURLHandleClient = [[WebMainResourceClient alloc] initWithDataSource: self];
-    [_private->mainHandle addClient: _private->mainURLHandleClient];
+    _private->mainResourceHandleClient = [[WebMainResourceClient alloc] initWithDataSource: self];
+    [_private->mainHandle addClient: _private->mainResourceHandleClient];
     
     // Mark the start loading time.
     _private->loadingStartedTime = CFAbsoluteTimeGetCurrent();
@@ -193,7 +193,7 @@
     [_private->mainHandle loadInBackground];
 }
 
-- (void)_addURLHandle: (WebResourceHandle *)handle
+- (void)_addResourceHandle: (WebResourceHandle *)handle
 {
     if (_private->urlHandles == nil)
         _private->urlHandles = [[NSMutableArray alloc] init];
@@ -201,7 +201,7 @@
     [self _setLoading:YES];
 }
 
-- (void)_removeURLHandle: (WebResourceHandle *)handle
+- (void)_removeResourceHandle: (WebResourceHandle *)handle
 {
     [_private->urlHandles removeObject: handle];
     [self _updateLoading];
diff --git a/WebKit/WebView.subproj/WebFrame.m b/WebKit/WebView.subproj/WebFrame.m
index 78658c3..9d6a8d7 100644
--- a/WebKit/WebView.subproj/WebFrame.m
+++ b/WebKit/WebView.subproj/WebFrame.m
@@ -80,8 +80,17 @@
 {
     --WebFrameCount;
     
+    // Because WebFrame objects are typically deallocated by timer cleanup, and the AppKit
+    // does not use an explicit autorelease pool in that case, we make our own.
+    // Among other things, this makes world leak checking in the Page Load Test work better.
+    // It would be nice to find a more general workaround for this (bug 3003650).
+    
+    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+    
     [_private release];
     [super dealloc];
+    
+    [pool release];
 }
 
 - (NSString *)name

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list