8036882: [macosx] Native memory leak in Java_sun_lwawt_macosx_CImage_nativeGetNSImageRepresentationSizes
authoralexsch
Fri, 28 Mar 2014 17:31:16 +0400
changeset 24137 b4066d0e2bca
parent 24136 fe3bc8c2dc51
child 24138 93734b110121
8036882: [macosx] Native memory leak in Java_sun_lwawt_macosx_CImage_nativeGetNSImageRepresentationSizes Reviewed-by: serb, pchelko
jdk/src/macosx/native/sun/awt/CImage.m
--- a/jdk/src/macosx/native/sun/awt/CImage.m	Fri Mar 28 14:53:19 2014 +0400
+++ b/jdk/src/macosx/native/sun/awt/CImage.m	Fri Mar 28 17:31:16 2014 +0400
@@ -379,7 +379,7 @@
         return getOrder(size1.width <= size2.width && size1.height <= size2.height);
     }];
 
-    NSMutableArray *sortedPixelSizes = [[NSMutableArray alloc] init];
+    NSMutableArray *sortedPixelSizes = [[[NSMutableArray alloc] init] autorelease];
     NSSize lastSize = [[sortedImageRepresentations lastObject] size];
     
     NSUInteger i = [sortedImageRepresentations indexOfObjectPassingTest: