[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:21:07 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit b6c3f0b12f3a5d9ae228b4cc1be4d66c15e0b846
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jun 25 07:33:45 2002 +0000

    	- fixed 2968298 -- IFImageRenderer crash at download.com
    
            * WebCoreSupport.subproj/IFImageRenderer.m:
            (-[IFImageRenderer initWithSize:]): Override this instead of [init].
    	This is the designated initializer and all the others call this.
            (-[IFImageRenderer copyWithZone:]): Override to nil out fields that
    	can't be shared by the copy.
    
    	Fix leaks.
    
            * History.subproj/IFURIEntry.m:
            (-[IFURIEntry initWithURL:title:image:]): Use copy instead of retain
    	in case we are passed a mutable string.
            (-[IFURIEntry dealloc]): Release _displayTitle. Fixes a leak.
            (-[IFURIEntry setTitle:]): Use copy instead of retain in case we are
    	passed a mutable string.
            (-[IFURIEntry setDisplayTitle:]): Use copy instead of retain in case
    	we are passed a mutable string.
            (-[IFURIEntry initFromDictionaryRepresentation:]): Lose the extra
    	retain for _lastVisitedDate. Fixes a leak.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1426 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 98c7489..501ad39 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,26 @@
+2002-06-25  Darin Adler  <darin at apple.com>
+
+	- fixed 2968298 -- IFImageRenderer crash at download.com
+
+        * WebCoreSupport.subproj/IFImageRenderer.m:
+        (-[IFImageRenderer initWithSize:]): Override this instead of [init].
+	This is the designated initializer and all the others call this.
+        (-[IFImageRenderer copyWithZone:]): Override to nil out fields that
+	can't be shared by the copy.
+
+	Fix leaks.
+
+        * History.subproj/IFURIEntry.m:
+        (-[IFURIEntry initWithURL:title:image:]): Use copy instead of retain
+	in case we are passed a mutable string.
+        (-[IFURIEntry dealloc]): Release _displayTitle. Fixes a leak.
+        (-[IFURIEntry setTitle:]): Use copy instead of retain in case we are
+	passed a mutable string.
+        (-[IFURIEntry setDisplayTitle:]): Use copy instead of retain in case
+	we are passed a mutable string.
+        (-[IFURIEntry initFromDictionaryRepresentation:]): Lose the extra
+	retain for _lastVisitedDate. Fixes a leak.
+
 2002-06-24  Darin Adler  <darin at apple.com>
 
         * Panels.subproj/IFStandardPanels.m:
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 98c7489..501ad39 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,26 @@
+2002-06-25  Darin Adler  <darin at apple.com>
+
+	- fixed 2968298 -- IFImageRenderer crash at download.com
+
+        * WebCoreSupport.subproj/IFImageRenderer.m:
+        (-[IFImageRenderer initWithSize:]): Override this instead of [init].
+	This is the designated initializer and all the others call this.
+        (-[IFImageRenderer copyWithZone:]): Override to nil out fields that
+	can't be shared by the copy.
+
+	Fix leaks.
+
+        * History.subproj/IFURIEntry.m:
+        (-[IFURIEntry initWithURL:title:image:]): Use copy instead of retain
+	in case we are passed a mutable string.
+        (-[IFURIEntry dealloc]): Release _displayTitle. Fixes a leak.
+        (-[IFURIEntry setTitle:]): Use copy instead of retain in case we are
+	passed a mutable string.
+        (-[IFURIEntry setDisplayTitle:]): Use copy instead of retain in case
+	we are passed a mutable string.
+        (-[IFURIEntry initFromDictionaryRepresentation:]): Lose the extra
+	retain for _lastVisitedDate. Fixes a leak.
+
 2002-06-24  Darin Adler  <darin at apple.com>
 
         * Panels.subproj/IFStandardPanels.m:
diff --git a/WebKit/History.subproj/IFURIEntry.m b/WebKit/History.subproj/IFURIEntry.m
index c2a8bb5..30ccf7b 100644
--- a/WebKit/History.subproj/IFURIEntry.m
+++ b/WebKit/History.subproj/IFURIEntry.m
@@ -3,7 +3,7 @@
 //  WebKit
 //
 //  Created by Kenneth Kocienda on Thu Nov 29 2001.
-//  Copyright (c) 2001 __MyCompanyName__. All rights reserved.
+//  Copyright (c) 2001, 2002 Apple Computer, Inc. All rights reserved.
 //
 
 #import "IFURIEntry.h"
@@ -31,7 +31,7 @@
     }
     
     _url = [url retain];
-    _title = [title retain];
+    _title = [title copy];
     _image = [image retain];
     _lastVisitedDate = [[NSCalendarDate alloc] init];
     
@@ -42,6 +42,7 @@
 {
     [_url release];
     [_title release];
+    [_displayTitle release];
     [_image release];
     [_lastVisitedDate release];
     
@@ -103,7 +104,7 @@
 {
     if (title != _title) {
         [_title release];
-        _title = [title retain];
+        _title = [title copy];
     }
 }
 
@@ -111,7 +112,7 @@
 {
     if (displayTitle != _displayTitle) {
         [_displayTitle release];
-        _displayTitle = [displayTitle retain];
+        _displayTitle = [displayTitle copy];
     }
 }
 
@@ -143,7 +144,7 @@
     result = NO;
 
     if ([anObject isMemberOfClass:[IFURIEntry class]]) {
-        result = [_url isEqual:[((IFURIEntry *)anObject) url]];
+        result = [_url isEqual:[anObject url]];
     }
     
     return result;
@@ -188,10 +189,10 @@
     if (storedURLString != nil) {
         _url = [[NSURL _IF_URLWithString:storedURLString] retain];
     }
-    _title = [[dict objectForKey: @"title"] retain];
-    _displayTitle = [[dict objectForKey: @"displayTitle"] retain];
-    _lastVisitedDate = [[[NSCalendarDate alloc] initWithTimeIntervalSinceReferenceDate:
-        [[dict objectForKey: @"lastVisitedDate"] doubleValue]] retain];
+    _title = [[dict objectForKey: @"title"] copy];
+    _displayTitle = [[dict objectForKey: @"displayTitle"] copy];
+    _lastVisitedDate = [[NSCalendarDate alloc] initWithTimeIntervalSinceReferenceDate:
+        [[dict objectForKey: @"lastVisitedDate"] doubleValue]];
 
     return self;
 }
diff --git a/WebKit/History.subproj/WebHistoryItem.m b/WebKit/History.subproj/WebHistoryItem.m
index c2a8bb5..30ccf7b 100644
--- a/WebKit/History.subproj/WebHistoryItem.m
+++ b/WebKit/History.subproj/WebHistoryItem.m
@@ -3,7 +3,7 @@
 //  WebKit
 //
 //  Created by Kenneth Kocienda on Thu Nov 29 2001.
-//  Copyright (c) 2001 __MyCompanyName__. All rights reserved.
+//  Copyright (c) 2001, 2002 Apple Computer, Inc. All rights reserved.
 //
 
 #import "IFURIEntry.h"
@@ -31,7 +31,7 @@
     }
     
     _url = [url retain];
-    _title = [title retain];
+    _title = [title copy];
     _image = [image retain];
     _lastVisitedDate = [[NSCalendarDate alloc] init];
     
@@ -42,6 +42,7 @@
 {
     [_url release];
     [_title release];
+    [_displayTitle release];
     [_image release];
     [_lastVisitedDate release];
     
@@ -103,7 +104,7 @@
 {
     if (title != _title) {
         [_title release];
-        _title = [title retain];
+        _title = [title copy];
     }
 }
 
@@ -111,7 +112,7 @@
 {
     if (displayTitle != _displayTitle) {
         [_displayTitle release];
-        _displayTitle = [displayTitle retain];
+        _displayTitle = [displayTitle copy];
     }
 }
 
@@ -143,7 +144,7 @@
     result = NO;
 
     if ([anObject isMemberOfClass:[IFURIEntry class]]) {
-        result = [_url isEqual:[((IFURIEntry *)anObject) url]];
+        result = [_url isEqual:[anObject url]];
     }
     
     return result;
@@ -188,10 +189,10 @@
     if (storedURLString != nil) {
         _url = [[NSURL _IF_URLWithString:storedURLString] retain];
     }
-    _title = [[dict objectForKey: @"title"] retain];
-    _displayTitle = [[dict objectForKey: @"displayTitle"] retain];
-    _lastVisitedDate = [[[NSCalendarDate alloc] initWithTimeIntervalSinceReferenceDate:
-        [[dict objectForKey: @"lastVisitedDate"] doubleValue]] retain];
+    _title = [[dict objectForKey: @"title"] copy];
+    _displayTitle = [[dict objectForKey: @"displayTitle"] copy];
+    _lastVisitedDate = [[NSCalendarDate alloc] initWithTimeIntervalSinceReferenceDate:
+        [[dict objectForKey: @"lastVisitedDate"] doubleValue]];
 
     return self;
 }
diff --git a/WebKit/WebCoreSupport.subproj/IFImageRenderer.m b/WebKit/WebCoreSupport.subproj/IFImageRenderer.m
index 1913cf3..ee0458e 100644
--- a/WebKit/WebCoreSupport.subproj/IFImageRenderer.m
+++ b/WebKit/WebCoreSupport.subproj/IFImageRenderer.m
@@ -24,14 +24,24 @@ static NSMutableArray *activeImageRenderers;
     
 }
 
-- init
+- initWithSize:(NSSize)size
 {
     lastStatus = -9999;
-    lastLength = 0;
-    return [super init];
+    return [super initWithSize:size];
 }
 
 
+- copyWithZone:(NSZone *)zone
+{
+    IFImageRenderer *copy = [super copyWithZone:zone];
+    
+    copy->frameTimer = nil;
+    copy->frameView = nil;
+    copy->patternColor = nil;
+    
+    return copy;
+}
+
 - (BOOL)incrementalLoadWithBytes: (const void *)bytes length:(unsigned)length complete:(BOOL)isComplete
 {
 // FIXME:  This won't compile unless you have > 6C48.
@@ -218,6 +228,7 @@ static NSMutableArray *activeImageRenderers;
 
 - (void)tileInRect:(NSRect)rect fromPoint:(NSPoint)point
 {
+    // FIXME: Does this optimization work right if the image is changed later?
     if (!patternColor)
         patternColor = [[NSColor colorWithPatternImage:self] retain];
     
@@ -238,6 +249,8 @@ static NSMutableArray *activeImageRenderers;
     [NSBezierPath fillRect:rect];
 
     [NSGraphicsContext restoreGraphicsState];
+
+    NSLog(@"used %@, retain count %d", patternColor, [patternColor retainCount]);
 }
 
 // required by protocol -- apparently inherited methods don't count
diff --git a/WebKit/WebCoreSupport.subproj/WebImageRenderer.m b/WebKit/WebCoreSupport.subproj/WebImageRenderer.m
index 1913cf3..ee0458e 100644
--- a/WebKit/WebCoreSupport.subproj/WebImageRenderer.m
+++ b/WebKit/WebCoreSupport.subproj/WebImageRenderer.m
@@ -24,14 +24,24 @@ static NSMutableArray *activeImageRenderers;
     
 }
 
-- init
+- initWithSize:(NSSize)size
 {
     lastStatus = -9999;
-    lastLength = 0;
-    return [super init];
+    return [super initWithSize:size];
 }
 
 
+- copyWithZone:(NSZone *)zone
+{
+    IFImageRenderer *copy = [super copyWithZone:zone];
+    
+    copy->frameTimer = nil;
+    copy->frameView = nil;
+    copy->patternColor = nil;
+    
+    return copy;
+}
+
 - (BOOL)incrementalLoadWithBytes: (const void *)bytes length:(unsigned)length complete:(BOOL)isComplete
 {
 // FIXME:  This won't compile unless you have > 6C48.
@@ -218,6 +228,7 @@ static NSMutableArray *activeImageRenderers;
 
 - (void)tileInRect:(NSRect)rect fromPoint:(NSPoint)point
 {
+    // FIXME: Does this optimization work right if the image is changed later?
     if (!patternColor)
         patternColor = [[NSColor colorWithPatternImage:self] retain];
     
@@ -238,6 +249,8 @@ static NSMutableArray *activeImageRenderers;
     [NSBezierPath fillRect:rect];
 
     [NSGraphicsContext restoreGraphicsState];
+
+    NSLog(@"used %@, retain count %d", patternColor, [patternColor retainCount]);
 }
 
 // required by protocol -- apparently inherited methods don't count

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list