From 2735e15bf5d4b3a976435ebb29ca9073de0e5071 Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 4 Jan 2015 03:57:26 +0100 Subject: 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. --- Source/SPDatabaseStructure.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Source/SPDatabaseStructure.m') diff --git a/Source/SPDatabaseStructure.m b/Source/SPDatabaseStructure.m index 70d0aee5..b34522c5 100644 --- a/Source/SPDatabaseStructure.m +++ b/Source/SPDatabaseStructure.m @@ -573,9 +573,9 @@ pthread_mutex_destroy(&dataLock); pthread_mutex_destroy(&connectionCheckLock); - if (mySQLConnection) [mySQLConnection release], mySQLConnection = nil; - if (structure) [structure release], structure = nil; - if (allKeysofDbStructure) [allKeysofDbStructure release], allKeysofDbStructure = nil; + if (mySQLConnection) SPClear(mySQLConnection); + if (structure) SPClear(structure); + if (allKeysofDbStructure) SPClear(allKeysofDbStructure); [super dealloc]; } -- cgit v1.2.3 From e201531daa71ee1a2e2a0f927c619947126c9d3d Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 4 Jan 2015 21:15:43 +0100 Subject: Addition to commit 2735e15b --- Source/SPDatabaseStructure.m | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'Source/SPDatabaseStructure.m') diff --git a/Source/SPDatabaseStructure.m b/Source/SPDatabaseStructure.m index b34522c5..2eab3562 100644 --- a/Source/SPDatabaseStructure.m +++ b/Source/SPDatabaseStructure.m @@ -567,7 +567,7 @@ [[NSNotificationCenter defaultCenter] removeObserver:self]; [self destroy:nil]; - [structureRetrievalThreads release]; + SPClear(structureRetrievalThreads); pthread_mutex_destroy(&threadManagementLock); pthread_mutex_destroy(&dataLock); @@ -630,8 +630,7 @@ } pthread_mutex_unlock(&threadManagementLock); - [mySQLConnection release]; - mySQLConnection = nil; + SPClear(mySQLConnection); } // Create a copy of the supplied connection -- cgit v1.2.3