Fixed <rdar://problem/3710313>: CGContext not zeroed when WebImageRenderer is copied
authorrjw <rjw@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Jun 2004 00:28:04 +0000 (00:28 +0000)
committerrjw <rjw@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Jun 2004 00:28:04 +0000 (00:28 +0000)
The context ivar of WebImageRenderer wasn't being nil when the object was copied.

        Reviewed by Darin.

        * WebCoreSupport.subproj/WebImageRenderer.m:
        (-[WebImageRenderer copyWithZone:]):
        (-[WebImageRenderer dealloc]):
        (-[WebImageRenderer drawImageInRect:fromRect:compositeOperator:context:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@6934 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKit/ChangeLog
WebKit/WebCoreSupport.subproj/WebImageRenderer.m

index 524729a9763c31e70f4195d3c217e2543c5c56d8..6fa734a0a7e7c9f2d80cc87dffc4934349856889 100644 (file)
@@ -1,3 +1,15 @@
+2004-06-24  Richard Williamson   <rjw@apple.com>
+
+               Fixed <rdar://problem/3710313>: CGContext not zeroed when WebImageRenderer is copied
+               The context ivar of WebImageRenderer wasn't being nil when the object was copied.
+
+        Reviewed by Darin.
+
+        * WebCoreSupport.subproj/WebImageRenderer.m:
+        (-[WebImageRenderer copyWithZone:]):
+        (-[WebImageRenderer dealloc]):
+        (-[WebImageRenderer drawImageInRect:fromRect:compositeOperator:context:]):
+
 2004-06-24  Trey Matteson  <trey@apple.com>
 
        3672725 - Assertion failure in URLCompletion code with particular set of bookmarks
index 31aebe0b4d212f1f17414785d0d39acc3efe229c..c2202b53213299def099c718b5fa3f9468514e9d 100644 (file)
@@ -287,6 +287,7 @@ static NSMutableSet *activeImageRenderers;
     copy->frameView = nil;
     copy->patternColor = nil;
     copy->compositeOperator = compositeOperator;
+    copy->context = 0;
         
     return copy;
 }
@@ -386,6 +387,7 @@ static NSMutableSet *activeImageRenderers;
     
     if (context) {
         CGContextRelease(context);
+        context = 0;
     }
 
     [_PDFDoc release];
@@ -679,10 +681,12 @@ static NSMutableSet *activeImageRenderers;
     compositeOperator = operator;
     
     if (aContext != context) {
-        if (aContext)
+        if (aContext) {
             CGContextRetain(aContext);
-        if (context)
+        }
+        if (context) {
             CGContextRelease(context);
+        }
         context = aContext;
     }