From 889d30b691d05408e9ff0f097327d139f6d54d5b Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Wed, 18 Jun 2008 09:26:40 -0400 Subject: [PATCH] Fix a few exceptions/warnings related to going no-gc * Source/AppDelegate.m (versionCheck:): Add an NSAutoreleasePool * Source/BreakpointManager.h: Specify an assignment type for the connection ivar * Source/SocketWrapper.m: (connect:): Add an NSAutoreleasePool --- Source/AppDelegate.m | 5 +++++ Source/BreakpointManager.h | 2 +- Source/SocketWrapper.m | 6 ++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Source/AppDelegate.m b/Source/AppDelegate.m index 6090105..06488e3 100644 --- a/Source/AppDelegate.m +++ b/Source/AppDelegate.m @@ -74,6 +74,8 @@ */ - (void)versionCheck:(id)sender { + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + NSMutableString *version = [NSMutableString stringWithString:[[[NSBundle mainBundle] infoDictionary] valueForKey:@"CFBundleShortVersionString"]]; [version replaceOccurrencesOfString:@" " withString:@"-" options:NSLiteralSearch range:NSMakeRange(0, [version length])]; @@ -84,6 +86,7 @@ if (result == nil) { + [pool release]; return; } @@ -95,6 +98,8 @@ [updateWindow makeKeyAndOrderFront:self]; [updateWindow center]; } + + [pool release]; } diff --git a/Source/BreakpointManager.h b/Source/BreakpointManager.h index f880698..21fd7fc 100644 --- a/Source/BreakpointManager.h +++ b/Source/BreakpointManager.h @@ -25,7 +25,7 @@ DebuggerConnection *connection; } -@property(readwrite) DebuggerConnection *connection; +@property(readwrite, assign) DebuggerConnection *connection; @property(readonly) NSMutableArray *breakpoints; + (BreakpointManager *)sharedManager; diff --git a/Source/SocketWrapper.m b/Source/SocketWrapper.m index ef707e8..f41b98c 100644 --- a/Source/SocketWrapper.m +++ b/Source/SocketWrapper.m @@ -97,6 +97,8 @@ */ - (void)connect:(id)obj { + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + // create an INET socket that we'll be listen()ing on int socketOpen = socket(PF_INET, SOCK_STREAM, 0); @@ -119,6 +121,7 @@ { close(socketOpen); [self error:@"Could not bind to socket"]; + [pool release]; return; } NSLog(@"couldn't bind to the socket... trying again in 5"); @@ -140,6 +143,7 @@ { close(socketOpen); [self error:@"Client failed to accept remote socket"]; + [pool release]; return; } @@ -156,6 +160,8 @@ hostname = [NSString stringWithUTF8String:name]; [connection performSelectorOnMainThread:@selector(socketDidAccept:) withObject:nil waitUntilDone:NO]; + + [pool release]; } /** -- 2.43.5