diff options
author | rowanbeentje <rowan@beent.je> | 2010-03-15 00:15:23 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2010-03-15 00:15:23 +0000 |
commit | 5a6d0f17bbf6b09463b908182dc2cbb112a0c6cb (patch) | |
tree | 4eb9575d7de321fc6f454892d0df13ddc4b6ce39 /Source/TableDocument.m | |
parent | 927784129ffd4d30e35f92a3fe6a8582219c64db (diff) | |
download | sequelpro-5a6d0f17bbf6b09463b908182dc2cbb112a0c6cb.tar.gz sequelpro-5a6d0f17bbf6b09463b908182dc2cbb112a0c6cb.tar.bz2 sequelpro-5a6d0f17bbf6b09463b908182dc2cbb112a0c6cb.zip |
Following a manual code review, fix some local variables overriding global variables, a few leaks, and additional nil setting/checking to prevent overreleases or releases of random areas of memory.
Diffstat (limited to 'Source/TableDocument.m')
-rw-r--r-- | Source/TableDocument.m | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Source/TableDocument.m b/Source/TableDocument.m index 443cadbb..2d75a8d9 100644 --- a/Source/TableDocument.m +++ b/Source/TableDocument.m @@ -80,6 +80,8 @@ selectedDatabase = nil; mySQLConnection = nil; mySQLVersion = nil; + allDatabases = nil; + allSystemDatabases = nil; printWebView = [[WebView alloc] init]; [printWebView setFrameLoadDelegate:self]; @@ -1043,7 +1045,7 @@ } // Close error status sheet for OPTIMIZE, CHECK, REPAIR etc. else if ([contextInfo isEqualToString:@"statusError"]) { - if(statusValues) [statusValues release]; statusValues = nil; + if (statusValues) [statusValues release], statusValues = nil; } } @@ -1200,7 +1202,7 @@ */ - (void) showTaskProgressWindow:(NSTimer *)theTimer { - [taskDrawTimer release], taskDrawTimer = nil; + if (taskDrawTimer) [taskDrawTimer invalidate], [taskDrawTimer release], taskDrawTimer = nil; // Center the task window and fade it in [self centerTaskWindow]; @@ -1775,6 +1777,7 @@ contextInfo:NULL]; } else { message = NSLocalizedString(@"MySQL said:",@"mysql said message"); + if (statusValues) [statusValues release], statusValues = nil; statusValues = [result retain]; NSAlert *alert = [[NSAlert new] autorelease]; [alert setInformativeText:message]; @@ -1850,6 +1853,7 @@ contextInfo:NULL]; } else { message = NSLocalizedString(@"MySQL said:",@"mysql said message"); + if (statusValues) [statusValues release], statusValues = nil; statusValues = [result retain]; NSAlert *alert = [[NSAlert new] autorelease]; [alert setInformativeText:message]; @@ -1925,6 +1929,7 @@ contextInfo:NULL]; } else { message = NSLocalizedString(@"MySQL said:",@"mysql said message"); + if (statusValues) [statusValues release], statusValues = nil; statusValues = [result retain]; NSAlert *alert = [[NSAlert new] autorelease]; [alert setInformativeText:message]; @@ -1999,6 +2004,7 @@ contextInfo:NULL]; } else { message = NSLocalizedString(@"MySQL said:",@"mysql said message"); + if (statusValues) [statusValues release], statusValues = nil; statusValues = [result retain]; NSAlert *alert = [[NSAlert new] autorelease]; [alert setInformativeText:message]; @@ -2073,6 +2079,7 @@ contextInfo:NULL]; } else { message = NSLocalizedString(@"MySQL said:",@"mysql said message"); + if (statusValues) [statusValues release], statusValues = nil; statusValues = [result retain]; NSAlert *alert = [[NSAlert new] autorelease]; [alert setInformativeText:message]; @@ -2128,6 +2135,7 @@ contextInfo:NULL]; } else { NSDictionary *result = [theResult fetch2DResultAsType:MCPTypeDictionary]; + if (statusValues) [statusValues release], statusValues = nil; statusValues = [result retain]; NSAlert *alert = [[NSAlert new] autorelease]; [alert setInformativeText:[NSString stringWithFormat:NSLocalizedString(@"Checksums of %@",@"Checksums of %@ message"), what]]; |