diff options
author | rowanbeentje <rowan@beent.je> | 2010-03-16 02:04:50 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2010-03-16 02:04:50 +0000 |
commit | 332f6201ce607a6622fadfd3e6426e4571dc035f (patch) | |
tree | 4e86f4ac81a9b13487482a8ec95dd2dc273f71d3 /Source/CustomQuery.m | |
parent | 1bfe991970009b1e7011823a00e676271fc04055 (diff) | |
download | sequelpro-332f6201ce607a6622fadfd3e6426e4571dc035f.tar.gz sequelpro-332f6201ce607a6622fadfd3e6426e4571dc035f.tar.bz2 sequelpro-332f6201ce607a6622fadfd3e6426e4571dc035f.zip |
- Make a number of changes to attempt to improve disconnection/quit crashes: prevent multiple disconnects, add more checks, cancel current queries, and add a tiny delay to allow mysql cleanup.
- Alter MCPStreamingResult to no longer return a retained instance, setting up correct result disposal on autorelease but changing callers to retain as soon as they receive.
- Review and change a number of local variables shadowing/shielding other local or global variables.
Diffstat (limited to 'Source/CustomQuery.m')
-rw-r--r-- | Source/CustomQuery.m | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Source/CustomQuery.m b/Source/CustomQuery.m index 1427291c..35338463 100644 --- a/Source/CustomQuery.m +++ b/Source/CustomQuery.m @@ -486,7 +486,7 @@ SEL callbackMethod = NULL; NSString *taskButtonString; - NSInteger i, j, totalQueriesRun = 0, totalAffectedRows = 0; + NSInteger i, totalQueriesRun = 0, totalAffectedRows = 0; double executionTime = 0; NSInteger firstErrorOccuredInQuery = -1; BOOL suppressErrorSheet = NO; @@ -548,7 +548,7 @@ [tempQueries addObject:query]; // Run the query, timing execution (note this also includes network and overhead) - streamingResult = [mySQLConnection streamingQueryString:query]; + streamingResult = [[mySQLConnection streamingQueryString:query] retain]; executionTime += [mySQLConnection lastQueryExecutionTime]; totalQueriesRun++; @@ -575,6 +575,8 @@ else if ( [streamingResult numOfRows] ) totalAffectedRows += [streamingResult numOfRows]; + [streamingResult release]; + // Store any error messages if ( ![[mySQLConnection getLastErrorMessage] isEqualToString:@""] || [mySQLConnection queryCancelled]) { @@ -731,7 +733,6 @@ // If no results were returned, redraw the empty table and post notifications before returning. if ( !resultDataCount ) { [customQueryView performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:YES]; - if (streamingResult) [streamingResult release]; // Notify any listeners that the query has completed [[NSNotificationCenter defaultCenter] postNotificationName:@"SMySQLQueryHasBeenPerformed" object:tableDocumentInstance]; |