aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/TableContent.m10
1 files changed, 7 insertions, 3 deletions
diff --git a/Source/TableContent.m b/Source/TableContent.m
index 67bb68b9..a7dfef7d 100644
--- a/Source/TableContent.m
+++ b/Source/TableContent.m
@@ -205,7 +205,10 @@
// Otherwise, clear sorting
} else {
- sortField = nil;
+ if (sortField) {
+ [sortField release];
+ sortField = nil;
+ }
isDesc = NO;
}
@@ -1739,7 +1742,8 @@ objectValueForTableColumn:(NSTableColumn *)aTableColumn
isDesc = NO;
[tableContentView setIndicatorImage:nil inTableColumn:[tableContentView tableColumnWithIdentifier:sortField]];
}
- sortField = [tableColumn identifier];
+ if (sortField) [sortField release];
+ sortField = [[NSString alloc] initWithString:[tableColumn identifier]];
//make queryString and perform query
queryString = [NSString stringWithFormat:@"SELECT %@ FROM %@ ORDER BY %@", [self fieldListForQuery],
@@ -2094,7 +2098,7 @@ objectValueForTableColumn:(NSTableColumn *)aTableColumn
[keys release];
[oldRow release];
[compareType release];
- [sortField release];
+ if (sortField) [sortField release];
[prefs release];
[super dealloc];