# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1303446180 0 # Node ID 8567c9ac089d7c4fdb07cad7e613ceb7d686c14e # Parent 44a0f9a2e8f94e57cb86a43ceb36ebf4b2bb8299 Switched back to using the dealloc() method in dw_pixmap_destroy() to stop a memory leak on the Mac. We are not really supposed to call dealloc directly usually but, not sure why release is not freeing the memory. diff -r 44a0f9a2e8f9 -r 8567c9ac089d mac/dw.m --- a/mac/dw.m Fri Apr 22 03:59:29 2011 +0000 +++ b/mac/dw.m Fri Apr 22 04:23:00 2011 +0000 @@ -430,6 +430,7 @@ { if([bltdest lockFocusIfCanDraw] == NO) { + free(bltinfo); return; } _DWLastDrawable = bltinfo->dest; @@ -5912,6 +5913,7 @@ pixmap->height = size.height; pixmap->image = image; pixmap->handle = handle; + [image retain]; return pixmap; } @@ -5938,6 +5940,7 @@ pixmap->height = size.height; pixmap->image = image; pixmap->handle = handle; + [image retain]; return pixmap; } @@ -5979,6 +5982,7 @@ pixmap->height = size.height; pixmap->image = image; pixmap->handle = handle; + [image retain]; return pixmap; } @@ -5991,7 +5995,7 @@ void API dw_pixmap_destroy(HPIXMAP pixmap) { NSBitmapImageRep *image = (NSBitmapImageRep *)pixmap->image; - [image release]; + [image dealloc]; free(pixmap); }