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

kocienda kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 05:51:28 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 397e5c03b8566d173939f7777c46e4ab5a79a4f2
Author: kocienda <kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Nov 3 00:50:18 2001 +0000

    Committed evil hack to prevent double freeing of image bytes since
    NSData doesn't give a sufficiently good *public* API.....ooof
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@405 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/kwq/KWQPixmap.mm b/WebCore/kwq/KWQPixmap.mm
index 03801cd..0115a0e 100644
--- a/WebCore/kwq/KWQPixmap.mm
+++ b/WebCore/kwq/KWQPixmap.mm
@@ -25,6 +25,15 @@
 
 #include <qpixmap.h>
 
+/*
+ * FIXME: This is a bad hack which really should go away.
+ * Here we're using private API to get around the problem 
+ * of image bytes being double freed.
+ */
+ at interface NSData (NSDataWebCoreExtensions)
+- (id)initWithBytes:(void *)bytes length:(unsigned)length copy:(BOOL)copy freeWhenDone:(BOOL)freeBytes bytesAreVM:(BOOL)vm;
+ at end
+
 
 QPixmap::QPixmap()
 {
@@ -40,7 +49,13 @@ QPixmap::QPixmap(const QSize&sz)
 
 QPixmap::QPixmap(const QByteArray&bytes)
 {
-    NSData *nsdata = [[[NSData alloc] initWithBytesNoCopy: bytes.data() length: bytes.size()] autorelease];
+    /*
+     * FIXME: This is a bad hack which really should go away.
+     * Here we're using private API to get around the problem 
+     * of image bytes being double freed.
+     */
+    //NSData *nsdata = [[[NSData alloc] initWithBytesNoCopy: bytes.data() length: bytes.size()] autorelease];
+    NSData *nsdata = [[[NSData alloc] initWithBytes: bytes.data() length: bytes.size() copy:NO freeWhenDone:NO bytesAreVM:NO] autorelease];
     nsimage = [[NSImage alloc] initWithData: nsdata];
     [nsimage setFlipped: YES];
 }
diff --git a/WebCore/src/kwq/KWQPixmap.mm b/WebCore/src/kwq/KWQPixmap.mm
index 03801cd..0115a0e 100644
--- a/WebCore/src/kwq/KWQPixmap.mm
+++ b/WebCore/src/kwq/KWQPixmap.mm
@@ -25,6 +25,15 @@
 
 #include <qpixmap.h>
 
+/*
+ * FIXME: This is a bad hack which really should go away.
+ * Here we're using private API to get around the problem 
+ * of image bytes being double freed.
+ */
+ at interface NSData (NSDataWebCoreExtensions)
+- (id)initWithBytes:(void *)bytes length:(unsigned)length copy:(BOOL)copy freeWhenDone:(BOOL)freeBytes bytesAreVM:(BOOL)vm;
+ at end
+
 
 QPixmap::QPixmap()
 {
@@ -40,7 +49,13 @@ QPixmap::QPixmap(const QSize&sz)
 
 QPixmap::QPixmap(const QByteArray&bytes)
 {
-    NSData *nsdata = [[[NSData alloc] initWithBytesNoCopy: bytes.data() length: bytes.size()] autorelease];
+    /*
+     * FIXME: This is a bad hack which really should go away.
+     * Here we're using private API to get around the problem 
+     * of image bytes being double freed.
+     */
+    //NSData *nsdata = [[[NSData alloc] initWithBytesNoCopy: bytes.data() length: bytes.size()] autorelease];
+    NSData *nsdata = [[[NSData alloc] initWithBytes: bytes.data() length: bytes.size() copy:NO freeWhenDone:NO bytesAreVM:NO] autorelease];
     nsimage = [[NSImage alloc] initWithData: nsdata];
     [nsimage setFlipped: YES];
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list