diff options
author | bamse16 <marius@marius.me.uk> | 2009-06-05 15:07:25 +0000 |
---|---|---|
committer | bamse16 <marius@marius.me.uk> | 2009-06-05 15:07:25 +0000 |
commit | 67a3148cec8bc7d1c6f52f60c8ce93a4fe0b8ece (patch) | |
tree | 14dbf0a8861ade6a232dfe2d0fdfab0807375aa5 /Source/TableDump.m | |
parent | b3d173a9bf9ade79a06202b5666b105936ef0dff (diff) | |
download | sequelpro-67a3148cec8bc7d1c6f52f60c8ce93a4fe0b8ece.tar.gz sequelpro-67a3148cec8bc7d1c6f52f60c8ce93a4fe0b8ece.tar.bz2 sequelpro-67a3148cec8bc7d1c6f52f60c8ce93a4fe0b8ece.zip |
Fixed some memory leaks found using llvm/clang. There are still some to fix
Diffstat (limited to 'Source/TableDump.m')
-rw-r--r-- | Source/TableDump.m | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/Source/TableDump.m b/Source/TableDump.m index 55c6fc21..5922ccd2 100644 --- a/Source/TableDump.m +++ b/Source/TableDump.m @@ -397,7 +397,7 @@ - (void)importBackgroundProcess:(NSString*)filename { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - SPSQLParser *dumpFile; + SPSQLParser *dumpFile = nil; NSError *errorStr = nil; NSMutableString *errors = [NSMutableString string]; NSString *fileType = [[importFormatPopup selectedItem] title]; @@ -523,8 +523,6 @@ } else if ( [fileType isEqualToString:@"CSV"] ) { int code; - NSPopUpButtonCell *buttonCell = [[NSPopUpButtonCell alloc] init]; - //open progress sheet [NSApp beginSheet:singleProgressSheet modalForWindow:tableWindow @@ -601,10 +599,12 @@ [recordCountLabel setStringValue:[NSString stringWithFormat:@"%i of %i records", currentRow+1, [importArray count]]]; //set up tableView buttons + NSPopUpButtonCell *buttonCell = [[NSPopUpButtonCell alloc] init]; [buttonCell setControlSize:NSSmallControlSize]; [buttonCell setFont:[NSFont labelFontOfSize:[NSFont smallSystemFontSize]]]; [buttonCell setBordered:NO]; [[fieldMappingTableView tableColumnWithIdentifier:@"value"] setDataCell:buttonCell]; + [buttonCell release]; [self updateFieldMappingButtonCell]; [fieldMappingTableView reloadData]; @@ -708,6 +708,7 @@ //free arrays fieldMappingArray = nil; importArray = nil; + } // Import finished Growl notification @@ -804,7 +805,8 @@ */ - (BOOL)dumpSelectedTablesAsSqlToFileHandle:(NSFileHandle *)fileHandle { - int i,j,t,rowCount, colCount, progressBarWidth, lastProgressValue, queryLength, tableType; + int i,j,t,rowCount, colCount, progressBarWidth, lastProgressValue, queryLength; + int tableType = SP_TABLETYPE_TABLE; //real tableType will be setup later CMMCPResult *queryResult; NSString *tableName, *tableColumnTypeGrouping, *previousConnectionEncoding; NSArray *fieldNames; @@ -825,7 +827,7 @@ [errorsView displayIfNeeded]; [singleProgressText setStringValue:NSLocalizedString(@"Dumping...", @"text showing that app is writing dump")]; [singleProgressText displayIfNeeded]; - progressBarWidth = (int)[singleProgressBar bounds].size.width; + //progressBarWidth = (int)[singleProgressBar bounds].size.width; [singleProgressBar setDoubleValue:0]; [singleProgressBar displayIfNeeded]; @@ -1283,7 +1285,7 @@ lineEndString = [NSString stringWithString:tempLineEndString]; // Updating the progress bar can take >20% of processing time - store details to only update when required - progressBarWidth = (int)[singleProgressBar bounds].size.width; + //progressBarWidth = (int)[singleProgressBar bounds].size.width; lastProgressValue = 0; [singleProgressBar setDoubleValue:0]; [singleProgressBar displayIfNeeded]; @@ -1605,7 +1607,7 @@ if (queryResult != nil && [queryResult numOfRows]) [queryResult dataSeek:0]; // Updating the progress bar can take >20% of processing time - store details to only update when required - progressBarWidth = (int)[singleProgressBar bounds].size.width; + //progressBarWidth = (int)[singleProgressBar bounds].size.width; lastProgressValue = 0; [singleProgressBar setDoubleValue:0]; [singleProgressBar displayIfNeeded]; @@ -2042,6 +2044,7 @@ [[exportDumpTableView tableColumnWithIdentifier:@"switch"] setDataCell:switchButton]; [[exportMultipleCSVTableView tableColumnWithIdentifier:@"switch"] setDataCell:switchButton]; [[exportMultipleXMLTableView tableColumnWithIdentifier:@"switch"] setDataCell:switchButton]; + [switchButton release]; if ( [prefs boolForKey:@"UseMonospacedFonts"] ) { [[[exportDumpTableView tableColumnWithIdentifier:@"tables"] dataCell] setFont:[NSFont fontWithName:@"Monaco" size:[NSFont smallSystemFontSize]]]; |