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

rjw rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:32:36 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 090d9399a51f0acbc77ead6e48ca653ff4e943ce
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Apr 7 00:24:23 2004 +0000

    	Fixed 3510805.  Only release pool in timer if the current nesting level of the
    	pool matches the nesting level when the pool was created.
    
            Reviewed by Chris.
    
            * Carbon.subproj/CarbonUtils.m:
            (getNumPools):
            (WebInitForCarbon):
            (PoolCleaner):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6322 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/Carbon.subproj/CarbonUtils.m b/WebKit/Carbon.subproj/CarbonUtils.m
index a6d0c08..411f28a 100644
--- a/WebKit/Carbon.subproj/CarbonUtils.m
+++ b/WebKit/Carbon.subproj/CarbonUtils.m
@@ -14,6 +14,16 @@ extern CGImageRef _NSCreateImageRef( unsigned char *const bitmapData[5], int pix
 static void				PoolCleaner( EventLoopTimerRef inTimer, EventLoopIdleTimerMessage inState, void *inUserData );
 
 static NSAutoreleasePool*	sPool;
+static unsigned numPools;
+
+static unsigned getNumPools()
+{
+    void *v = NSPushAutoreleasePool(0);
+    unsigned numPools = (unsigned)(v);
+    NSPopAutoreleasePool (v);
+    return numPools;
+}
+
 
 void
 WebInitForCarbon()
@@ -28,8 +38,9 @@ WebInitForCarbon()
         // "flavour" is correctly established.
         GetCurrentProcess( &process ); 
         NSApplicationLoad();
-        
+                
         sPool = [[NSAutoreleasePool allocWithZone:NULL] init];
+        numPools = getNumPools();
         
         InstallEventLoopIdleTimer( GetMainEventLoop(), 1.0, 0, PoolCleaner, 0, NULL );
         
@@ -37,6 +48,7 @@ WebInitForCarbon()
     }
 }
 
+
 static void
 PoolCleaner( EventLoopTimerRef inTimer, EventLoopIdleTimerMessage inState, void *inUserData )
 {
@@ -45,8 +57,13 @@ PoolCleaner( EventLoopTimerRef inTimer, EventLoopIdleTimerMessage inState, void
         CFStringRef mode = CFRunLoopCopyCurrentMode( (CFRunLoopRef)GetCFRunLoopFromEventLoop( GetCurrentEventLoop() ));
         if ( CFEqual( mode, kCFRunLoopDefaultMode ) )
         {
-            [sPool release];
-            sPool = [[NSAutoreleasePool allocWithZone:NULL] init];
+            unsigned currentNumPools = getNumPools()-1;            
+            if (currentNumPools == numPools){
+                [sPool release];
+                sPool = [[NSAutoreleasePool allocWithZone:NULL] init];
+                numPools = getNumPools();
+            }
+
         }
         CFRelease( mode );
 	}
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index aa3815b..2112634 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,15 @@
+2004-04-06  Richard Williamson   <rjw at apple.com>
+
+	Fixed 3510805.  Only release pool in timer if the current nesting level of the
+	pool matches the nesting level when the pool was created.
+
+        Reviewed by Chris.
+
+        * Carbon.subproj/CarbonUtils.m:
+        (getNumPools):
+        (WebInitForCarbon):
+        (PoolCleaner):
+
 2004-04-06  Chris Blumenberg  <cblu at apple.com>
 
 	Fixed: <rdar://problem/3613974>: remove "to Clipboard" from context menus because it is redundant

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list