From: Michael J. Rubinsky Date: Tue, 11 Aug 2009 22:55:11 +0000 (-0400) Subject: Some memory management cleanup.. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=941118259bbcdb3005a18684a6fa87456e527cb4;p=horde.git Some memory management cleanup.. XCode instruments now reports no memory leaks in this code :) Enable GC support in the release build now that all the leaks are resolved. --- diff --git a/iPhoto2Ansel/AnselExportController.m b/iPhoto2Ansel/AnselExportController.m index ec5317fe4..0e127c69d 100644 --- a/iPhoto2Ansel/AnselExportController.m +++ b/iPhoto2Ansel/AnselExportController.m @@ -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; diff --git a/iPhoto2Ansel/AnselGalleryViewItem.m b/iPhoto2Ansel/AnselGalleryViewItem.m index b920f8c5b..e792d14dd 100644 --- a/iPhoto2Ansel/AnselGalleryViewItem.m +++ b/iPhoto2Ansel/AnselGalleryViewItem.m @@ -49,7 +49,7 @@ - (id)imageRepresentation { - return image; + return [[image retain] autorelease]; } #pragma mark diff --git a/iPhoto2Ansel/TURAnsel.m b/iPhoto2Ansel/TURAnsel.m index 80d1f3111..6681495c4 100644 --- a/iPhoto2Ansel/TURAnsel.m +++ b/iPhoto2Ansel/TURAnsel.m @@ -154,6 +154,7 @@ XMLRPCResponse *response = [[connection response] autorelease]; [credentials release]; [connection release]; + [request release]; return response; } else { state = TURAnselStateError; @@ -163,6 +164,7 @@ } [error autorelease]; [connection release]; + [request release]; return nil; } diff --git a/iPhoto2Ansel/iPhoto2Ansel.xcodeproj/project.pbxproj b/iPhoto2Ansel/iPhoto2Ansel.xcodeproj/project.pbxproj index 0c591b34c..dba546165 100644 --- a/iPhoto2Ansel/iPhoto2Ansel.xcodeproj/project.pbxproj +++ b/iPhoto2Ansel/iPhoto2Ansel.xcodeproj/project.pbxproj @@ -499,6 +499,7 @@ ); 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; @@ -521,6 +522,7 @@ "$(inherited)", "\"$(SRCROOT)\"", ); + GCC_ENABLE_OBJC_GC = supported; GCC_MODEL_TUNING = G5; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = iPhoto2Ansel_Prefix.pch; @@ -574,6 +576,7 @@ 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; @@ -603,6 +606,7 @@ 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"; diff --git a/iPhoto2Ansel/xmlrpc-1.5.1/XMLRPCConnection.m b/iPhoto2Ansel/xmlrpc-1.5.1/XMLRPCConnection.m index 49c685346..cb0b9afa5 100644 --- a/iPhoto2Ansel/xmlrpc-1.5.1/XMLRPCConnection.m +++ b/iPhoto2Ansel/xmlrpc-1.5.1/XMLRPCConnection.m @@ -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];