aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPTableContent.m
diff options
context:
space:
mode:
authorMax <post@wickenrode.com>2015-01-04 03:57:26 +0100
committerMax <post@wickenrode.com>2015-01-04 03:57:26 +0100
commit2735e15bf5d4b3a976435ebb29ca9073de0e5071 (patch)
treee2088e442aa2d100ceafd8c0c4789e033fd12ac3 /Source/SPTableContent.m
parentdb64bd1b5affd00332906901ee57d6f681faf7ea (diff)
downloadsequelpro-2735e15bf5d4b3a976435ebb29ca9073de0e5071.tar.gz
sequelpro-2735e15bf5d4b3a976435ebb29ca9073de0e5071.tar.bz2
sequelpro-2735e15bf5d4b3a976435ebb29ca9073de0e5071.zip
Formalize [x release], x = nil; convention
Take this commit as a proposal to formalize our existing "[x release], x = nil;" convention by introducing a macro for it. Feel free to revert this commit if you see issues with the approch or implementation.
Diffstat (limited to 'Source/SPTableContent.m')
-rw-r--r--Source/SPTableContent.m22
1 files changed, 11 insertions, 11 deletions
diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m
index d904ab73..b0d0f03c 100644
--- a/Source/SPTableContent.m
+++ b/Source/SPTableContent.m
@@ -407,7 +407,7 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper
#endif
// Reset table key store for use in argumentForRow:
- if (keys) [keys release], keys = nil;
+ if (keys) SPClear(keys);
// Reset data column store
[dataColumns removeAllObjects];
@@ -425,7 +425,7 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper
// Otherwise store the newly selected table name and reset the data
} else {
- if (selectedTable) [selectedTable release], selectedTable = nil;
+ if (selectedTable) SPClear(selectedTable);
if (newTableName) selectedTable = [[NSString alloc] initWithString:newTableName];
previousTableRowsCount = 0;
contentPage = 1;
@@ -1509,7 +1509,7 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper
// If a string was supplied, use a custom query from that URL scheme
else if([sender isKindOfClass:[NSString class]] && [(NSString *)sender length]) {
- if(schemeFilter) [schemeFilter release], schemeFilter = nil;
+ if(schemeFilter) SPClear(schemeFilter);
schemeFilter = [sender retain];
activeFilter = 2;
}
@@ -3942,7 +3942,7 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper
*/
- (void) setSortColumnNameToRestore:(NSString *)theSortColumnName isAscending:(BOOL)isAscending
{
- if (sortColumnToRestore) [sortColumnToRestore release], sortColumnToRestore = nil;
+ if (sortColumnToRestore) SPClear(sortColumnToRestore);
if (theSortColumnName) {
sortColumnToRestore = [[NSString alloc] initWithString:theSortColumnName];
@@ -3963,7 +3963,7 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper
*/
- (void) setSelectionToRestore:(NSDictionary *)theSelection
{
- if (selectionToRestore) [selectionToRestore release], selectionToRestore = nil;
+ if (selectionToRestore) SPClear(selectionToRestore);
if (theSelection) selectionToRestore = [theSelection copy];
}
@@ -3981,11 +3981,11 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper
*/
- (void) setFiltersToRestore:(NSDictionary *)filterSettings
{
- if (filterFieldToRestore) [filterFieldToRestore release], filterFieldToRestore = nil;
- if (filterComparisonToRestore) [filterComparisonToRestore release], filterComparisonToRestore = nil;
- if (filterValueToRestore) [filterValueToRestore release], filterValueToRestore = nil;
- if (firstBetweenValueToRestore) [firstBetweenValueToRestore release], firstBetweenValueToRestore = nil;
- if (secondBetweenValueToRestore) [secondBetweenValueToRestore release], secondBetweenValueToRestore = nil;
+ if (filterFieldToRestore) SPClear(filterFieldToRestore);
+ if (filterComparisonToRestore) SPClear(filterComparisonToRestore);
+ if (filterValueToRestore) SPClear(filterValueToRestore);
+ if (firstBetweenValueToRestore) SPClear(firstBetweenValueToRestore);
+ if (secondBetweenValueToRestore) SPClear(secondBetweenValueToRestore);
if (filterSettings) {
if ([filterSettings objectForKey:@"filterField"])
@@ -4311,7 +4311,7 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper
[NSObject cancelPreviousPerformRequestsWithTarget:self];
[NSObject cancelPreviousPerformRequestsWithTarget:tableContentView];
- if(fieldEditor) [fieldEditor release], fieldEditor = nil;
+ if(fieldEditor) SPClear(fieldEditor);
[self clearTableLoadTimer];
[tableLoadingCondition release];