Some memory management cleanup..
authorMichael J. Rubinsky <mrubinsk@horde.org>
Tue, 11 Aug 2009 22:55:11 +0000 (18:55 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Tue, 11 Aug 2009 22:57:09 +0000 (18:57 -0400)
XCode instruments now reports no memory leaks in this code :) Enable GC support
in the release build now that all the leaks are resolved.

iPhoto2Ansel/AnselExportController.m
iPhoto2Ansel/AnselGalleryViewItem.m
iPhoto2Ansel/TURAnsel.m
iPhoto2Ansel/iPhoto2Ansel.xcodeproj/project.pbxproj
iPhoto2Ansel/xmlrpc-1.5.1/XMLRPCConnection.m

index ec5317f..0e127c6 100644 (file)
@@ -672,6 +672,7 @@ NSString * const TURAnselServerPasswordKey = @"password";
             NSBitmapImageRep *bitmap = [[NSBitmapImageRep alloc] initWithCIImage: im];
             NSDictionary *properties = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithFloat: 1.0], NSImageCompressionFactor, nil];
             scaledData = [bitmap representationUsingType:NSPNGFileType properties:properties]; 
+            [bitmap release];
 
         } else {
             scaledData = theImageData;
index b920f8c..e792d14 100644 (file)
@@ -49,7 +49,7 @@
 
 - (id)imageRepresentation
 {
-    return image;
+    return [[image retain] autorelease];
 }
 
 #pragma mark
index 80d1f31..6681495 100644 (file)
         XMLRPCResponse *response = [[connection response] autorelease];
         [credentials release];
         [connection release];
+        [request release];
         return response;
     } else {
         state = TURAnselStateError;
         }
         [error autorelease];
         [connection release];
+        [request release];
         return nil;
     }
 
index 0c591b3..dba5461 100644 (file)
                                );
                                GCC_DYNAMIC_NO_PIC = NO;
                                GCC_ENABLE_FIX_AND_CONTINUE = YES;
+                               GCC_ENABLE_OBJC_GC = supported;
                                GCC_MODEL_TUNING = G5;
                                GCC_OPTIMIZATION_LEVEL = 0;
                                GCC_PRECOMPILE_PREFIX_HEADER = YES;
                                        "$(inherited)",
                                        "\"$(SRCROOT)\"",
                                );
+                               GCC_ENABLE_OBJC_GC = supported;
                                GCC_MODEL_TUNING = G5;
                                GCC_PRECOMPILE_PREFIX_HEADER = YES;
                                GCC_PREFIX_HEADER = iPhoto2Ansel_Prefix.pch;
                                FRAMEWORK_VERSION = A;
                                GCC_DYNAMIC_NO_PIC = NO;
                                GCC_ENABLE_FIX_AND_CONTINUE = YES;
+                               GCC_ENABLE_OBJC_GC = supported;
                                GCC_MODEL_TUNING = G5;
                                GCC_OPTIMIZATION_LEVEL = 0;
                                GCC_PRECOMPILE_PREFIX_HEADER = YES;
                                DYLIB_CURRENT_VERSION = 1;
                                FRAMEWORK_VERSION = A;
                                GCC_ENABLE_FIX_AND_CONTINUE = NO;
+                               GCC_ENABLE_OBJC_GC = supported;
                                GCC_MODEL_TUNING = G5;
                                GCC_PRECOMPILE_PREFIX_HEADER = YES;
                                GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h";
index 49c6853..cb0b9af 100644 (file)
@@ -60,6 +60,7 @@ NSString *XMLRPCReceivedResponseNotification = @"XML-RPC Successfully Received R
 
 - (id)initWithXMLRPCRequest: (XMLRPCRequest *)request delegate: (id)delegate {
        if (self = [super init]) {
+        [request retain];
                incomingXMLData = [[NSMutableData alloc] init];
                currentConnection = [[NSURLConnection alloc] initWithRequest: [request request] delegate: self];