aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPCustomQuery.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/SPCustomQuery.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/SPCustomQuery.m')
-rw-r--r--Source/SPCustomQuery.m14
1 files changed, 7 insertions, 7 deletions
diff --git a/Source/SPCustomQuery.m b/Source/SPCustomQuery.m
index 8b201776..2114d766 100644
--- a/Source/SPCustomQuery.m
+++ b/Source/SPCustomQuery.m
@@ -141,7 +141,7 @@
// Re-init sort order
isDesc = NO;
sortColumn = nil;
- if(sortField) [sortField release], sortField = nil;
+ if(sortField) SPClear(sortField);
// Retrieve the custom query string and split it into separate SQL queries
queryParser = [[SPSQLParser alloc] initWithString:[textView string]];
@@ -185,7 +185,7 @@
// Re-init sort order
isDesc = NO;
sortColumn = nil;
- if(sortField) [sortField release], sortField = nil;
+ if(sortField) SPClear(sortField);
// If the current selection is a single caret position, run the current query.
if (selectedRange.length == 0) {
@@ -628,7 +628,7 @@
// Remove all the columns if not reloading the table
if(!reloadingExistingResult) {
- if (cqColumnDefinition) [cqColumnDefinition release], cqColumnDefinition = nil;
+ if (cqColumnDefinition) SPClear(cqColumnDefinition);
[[self onMainThread] updateTableView];
}
@@ -1736,7 +1736,7 @@
*/
- (void)setResultSelectedRowIndexesToRestore:(NSIndexSet *)theIndexSet
{
- if (selectionIndexToRestore) [selectionIndexToRestore release], selectionIndexToRestore = nil;
+ if (selectionIndexToRestore) SPClear(selectionIndexToRestore);
if (theIndexSet) selectionIndexToRestore = [[NSIndexSet alloc] initWithIndexSet:theIndexSet];
}
@@ -2273,7 +2273,7 @@
if ([mySQLConnection queryErrored]) {
sortColumn = nil;
- if(sortField) [sortField release], sortField = nil;
+ if(sortField) SPClear(sortField);
return;
}
@@ -2449,7 +2449,7 @@
// Open the editing sheet if required
if ([customQueryView shouldUseFieldEditorForRow:rowIndex column:[[aTableColumn identifier] integerValue] checkWithLock:NULL])
{
- if (fieldEditor) [fieldEditor release], fieldEditor = nil;
+ if (fieldEditor) SPClear(fieldEditor);
fieldEditor = [[SPFieldEditorController alloc] init];
// Remember edited row for reselecting and setting the scroll view after reload
@@ -4042,7 +4042,7 @@
[resultData release];
[favoritesManager release];
- if(fieldEditor) [fieldEditor release], fieldEditor = nil;
+ if(fieldEditor) SPClear(fieldEditor);
#ifndef SP_CODA
if (helpHTMLTemplate) [helpHTMLTemplate release];