aboutsummaryrefslogtreecommitdiffstats
path: root/Source/CustomQuery.m
diff options
context:
space:
mode:
Diffstat (limited to 'Source/CustomQuery.m')
-rw-r--r--Source/CustomQuery.m7
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];