diff options
author | rowanbeentje <rowan@beent.je> | 2009-12-14 01:23:29 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2009-12-14 01:23:29 +0000 |
commit | 5247ac10ff8d1fe91756c60dfd05605e8bc3d884 (patch) | |
tree | 5aa40a57a722c2b38d9759ff772530960d3d3d98 /Source/CustomQuery.m | |
parent | 5298595375e55bb70edae0ddf17d921a299b1014 (diff) | |
download | sequelpro-5247ac10ff8d1fe91756c60dfd05605e8bc3d884.tar.gz sequelpro-5247ac10ff8d1fe91756c60dfd05605e8bc3d884.tar.bz2 sequelpro-5247ac10ff8d1fe91756c60dfd05605e8bc3d884.zip |
- Work through static analysis of the source, fixing a number of small memory leaks and fixing a couple of over-releases
Diffstat (limited to 'Source/CustomQuery.m')
-rw-r--r-- | Source/CustomQuery.m | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Source/CustomQuery.m b/Source/CustomQuery.m index 6a979509..0982e16f 100644 --- a/Source/CustomQuery.m +++ b/Source/CustomQuery.m @@ -107,7 +107,7 @@ - (IBAction)runSelectedQueries:(id)sender { NSArray *queries; - NSString *query; + NSString *query = nil; NSRange selectedRange = [textView selectedRange]; SPSQLParser *queryParser; @@ -726,7 +726,7 @@ // If no results were returned, redraw the empty table and post notifications before returning. if ( !fullResultCount ) { [customQueryView reloadData]; - [streamingResult release]; + if (streamingResult) [streamingResult release]; // Notify any listeners that the query has completed [[NSNotificationCenter defaultCenter] postNotificationName:@"SMySQLQueryHasBeenPerformed" object:tableDocumentInstance]; @@ -753,11 +753,9 @@ // If more than one table name is found set resultTableName to nil. // resultTableName will be set to the original table name (not defined via AS) provided by mysql return // and the resultTableName can differ due to case-sensitive/insensitive settings!. - BOOL resultShowsColumnsFromOneTable = YES; NSString *resultTableName = [[cqColumnDefinition objectAtIndex:0] objectForKey:@"org_table"]; for(id field in cqColumnDefinition) { if(![[field objectForKey:@"org_table"] isEqualToString:resultTableName]) { - resultShowsColumnsFromOneTable = NO; resultTableName = nil; break; } @@ -2772,7 +2770,7 @@ [prefs setObject:favorites forKey:SPQueryFavorites]; } else { [[SPQueryController sharedQueryController] addFavorite:[NSMutableDictionary dictionaryWithObjects: - [NSArray arrayWithObjects:[queryFavoriteNameTextField stringValue], [queryToBeAddded mutableCopy], nil] + [NSArray arrayWithObjects:[queryFavoriteNameTextField stringValue], [[queryToBeAddded mutableCopy] autorelease], nil] forKeys:[NSArray arrayWithObjects:@"name", @"query", nil]] forFileURL:[tableDocumentInstance fileURL]]; } |