From 86eabf40de529ae7ba8dd4704edb1e43ebcfe235 Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Tue, 18 Aug 2009 17:57:04 +0000 Subject: 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. --- Source/CMCopyTable.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Source') 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 -- cgit v1.2.3