[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:36:51 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 065ba9164ea25cc28688e950d7441b607d3905cf
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Sep 6 22:56:33 2002 +0000

    	Leak fixes and other related changes.
    
            * CacheLoader.subproj/WebResourceHandleInternal.m:
            (-[WebResourceHandleInstanceVariables prepareCallbacks]): Retain the
    	callbackData to give it a more normal lifetime.
            (-[WebResourceHandleInstanceVariables dealloc]): Release response to fix
    	a leak, and callbackData to match the change above.
            (-[WebResourceHandle _sendCallbacks]): Handle fail in a way that is parallel
    	to finish, rather than parallel to cancel. And put the rule about not delivering
    	any more callbacks after the end state at this level instead of in each function.
            (-[WebResourceHandle _notifyClientDidBeginLoading]): Remove unnecessary locking.
            (-[WebResourceHandle _notifyClientDidCancelLoading]): Ditto.
            (-[WebResourceHandle _notifyClientDidRedirectToURL]): Ditto.
            (-[WebResourceHandle _notifyClientDataDidBecomeAvailable]): Ditto.
            (-[WebResourceHandle _notifyClientDidFailLoading]): Ditto.
            (-[WebResourceHandle _notifyClientDidFinishLoading]): Ditto.
            * CacheLoader.subproj/WebSimpleHTTPProtocolHandler.m:
            (-[WebSimpleHTTPProtocolHandler dealloc]): Release responseDataGuard to fix a leak.
    
            * Misc.subproj/WebQueue.m:
            (-[WebQueue take]): Rewrite the wait loop for clarity. Add code to update tail when
    	taking the last element from the queue; fixes a bug.
            (-[WebQueue remove:]): Add code to update tail when removing the last element.
    
            * CacheLoader.subproj/WebResourceLoadQueue.m: -[WebResourceLoadQueue put:]): Tweak.
    
            * CacheLoader.subproj/WebResourceLoad.m:
            (_loadBegin): Add an autorelease pool.
            (_loadSweeper): Add an autorelease pool.
    
            * Database.subproj/WebFileDatabase.m:
            (-[WebFileDatabaseOp initWithCode:key:object:]): Remove unneeded release of nil.
            (-[WebFileDatabase objectForKey:]): Tweak and remove an unnecessary "volatile".
    
            * Misc.subproj/WebSystemBits.m: (WebSetThreadPriority): Use FATAL instead of printf.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1986 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/Misc.subproj/WebFileDatabase.m b/WebKit/Misc.subproj/WebFileDatabase.m
index d1c8c72..24532d1 100644
--- a/WebKit/Misc.subproj/WebFileDatabase.m
+++ b/WebKit/Misc.subproj/WebFileDatabase.m
@@ -270,7 +270,6 @@ static void URLFileReaderInit(void)
         return self;
     }
   
-    [self release];
     return nil;
 }
 
@@ -301,7 +300,7 @@ static void URLFileReaderInit(void)
             [target performRemoveObjectForKey:key];
             break;
         default:
-            ASSERT(nil);
+            ASSERT_NOT_REACHED();
             break;
     }
 }
@@ -570,18 +569,7 @@ static void databaseInit()
 -(id)objectForKey:(id)key
 {
     volatile id result;
-    id fileKey;
-    id object;
-    NSString *filePath;
-    WebFileReader * volatile fileReader;
-    NSData *data;
-    NSUnarchiver * volatile unarchiver;
-        
-    fileKey = nil;
-    fileReader = nil;
-    data = nil;
-    unarchiver = nil;
-
+    
     ASSERT(key);
 
     touch = CFAbsoluteTimeGetCurrent();
@@ -599,20 +587,25 @@ static void databaseInit()
     [mutex unlock];
 
     // go to disk
-    filePath = [[NSString alloc] initWithFormat:@"%@/%@", path, [WebFileDatabase uniqueFilePathForKey:key]];
-    fileReader = [[WebFileReader alloc] initWithPath:filePath];
+    NSString *filePath = [[NSString alloc] initWithFormat:@"%@/%@", path, [WebFileDatabase uniqueFilePathForKey:key]];
+    WebFileReader *fileReader = [[WebFileReader alloc] initWithPath:filePath];
     
+    NSData *data;
+    NSUnarchiver * volatile unarchiver = nil;
+
     NS_DURING
         if (fileReader && (data = [fileReader data])) {
             unarchiver = [[NSUnarchiver alloc] initForReadingWithData:data];
-        }
-        if (unarchiver) {
-            fileKey = [unarchiver decodeObject];
-            object = [unarchiver decodeObject];
-            if (object && [fileKey isEqual:key]) {
-                // make sure this object stays around until client has had a chance at it
-                result = [object retain];
-                [result autorelease];
+            if (unarchiver) {
+                id fileKey = [unarchiver decodeObject];
+                if ([fileKey isEqual:key]) {
+                    id object = [unarchiver decodeObject];
+                    if (object) {
+                        // Decoded objects go away when the unarchiver does, so we need to
+                        // retain this so we can return it to our caller.
+                        result = [[object retain] autorelease];
+                    }
+                }
             }
         }
     NS_HANDLER

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list