aboutsummaryrefslogtreecommitdiffstats
path: root/Source/CMCopyTable.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2009-08-18 17:57:04 +0000
committerstuconnolly <stuart02@gmail.com>2009-08-18 17:57:04 +0000
commit86eabf40de529ae7ba8dd4704edb1e43ebcfe235 (patch)
tree66fb0e0b97e689695546087a9eeee12df209c8ce /Source/CMCopyTable.m
parent1685f5628ceefbe4651ba5608484ab0d683b041f (diff)
downloadsequelpro-86eabf40de529ae7ba8dd4704edb1e43ebcfe235.tar.gz
sequelpro-86eabf40de529ae7ba8dd4704edb1e43ebcfe235.tar.bz2
sequelpro-86eabf40de529ae7ba8dd4704edb1e43ebcfe235.zip
Fix a memory leak when loading a table's content. When setting the column definitions in CMCopyTable, the array wasn't being released on subsequent allocations.
Diffstat (limited to 'Source/CMCopyTable.m')
-rw-r--r--Source/CMCopyTable.m5
1 files changed, 4 insertions, 1 deletions
diff --git a/Source/CMCopyTable.m b/Source/CMCopyTable.m
index a6189d13..e3a2c0b9 100644
--- a/Source/CMCopyTable.m
+++ b/Source/CMCopyTable.m
@@ -397,11 +397,14 @@ int MENU_EDIT_COPY_AS_SQL = 2002;
*/
- (void)setTableInstance:(id)anInstance withTableData:(id)theTableData withColumns:(NSArray *)columnDefs withTableName:(NSString *)aTableName withConnection:(id)aMySqlConnection
{
- columnDefinitions = [[NSArray arrayWithArray:columnDefs] retain];
selectedTable = aTableName;
tableData = theTableData;
mySQLConnection = aMySqlConnection;
tableInstance = anInstance;
+
+ if (columnDefinitions) [columnDefinitions release];
+
+ columnDefinitions = [[NSArray alloc] initWithArray:columnDefs];
}
@end