diff options
author | Max <post@wickenrode.com> | 2015-01-04 03:57:26 +0100 |
---|---|---|
committer | Max <post@wickenrode.com> | 2015-01-04 03:57:26 +0100 |
commit | 2735e15bf5d4b3a976435ebb29ca9073de0e5071 (patch) | |
tree | e2088e442aa2d100ceafd8c0c4789e033fd12ac3 /Source/SPSSHTunnel.m | |
parent | db64bd1b5affd00332906901ee57d6f681faf7ea (diff) | |
download | sequelpro-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/SPSSHTunnel.m')
-rw-r--r-- | Source/SPSSHTunnel.m | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Source/SPSSHTunnel.m b/Source/SPSSHTunnel.m index 20f1aa43..c9a214ab 100644 --- a/Source/SPSSHTunnel.m +++ b/Source/SPSSHTunnel.m @@ -126,8 +126,8 @@ { // As this object is not a NSWindowController, use manual top-level nib item management - if (sshQuestionDialog) [sshQuestionDialog release], sshQuestionDialog = nil; - if (sshPasswordDialog) [sshPasswordDialog release], sshPasswordDialog = nil; + if (sshQuestionDialog) SPClear(sshQuestionDialog); + if (sshPasswordDialog) SPClear(sshPasswordDialog); parentWindow = theWindow; if (![NSBundle loadNibNamed:@"SSHQuestionDialog" owner:self]) { @@ -167,7 +167,7 @@ */ - (BOOL)setPasswordKeychainName:(NSString *)theName account:(NSString *)theAccount { - if (password) [password release], password = nil; + if (password) SPClear(password); passwordInKeychain = YES; keychainName = [[NSString alloc] initWithString:theName]; @@ -420,8 +420,8 @@ [task waitUntilExit]; // On tunnel close, clean up, ready for re-use if the delegate reconnects. - [task release], task = nil; - [standardError release], standardError = nil; + SPClear(task); + SPClear(standardError); [[NSNotificationCenter defaultCenter] removeObserver:self name:@"NSFileHandleDataAvailableNotification" object:nil]; @@ -438,8 +438,8 @@ // Run the run loop for a short time to ensure all task/pipe callbacks are dealt with [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:1.0]]; - [taskEnvironment release], taskEnvironment = nil; - [taskArguments release], taskArguments = nil; + SPClear(taskEnvironment); + SPClear(taskArguments); [pool release]; } @@ -647,7 +647,7 @@ NSString *thePassword = nil; if (requestedPassphrase) { thePassword = [NSString stringWithString:requestedPassphrase]; - [requestedPassphrase release], requestedPassphrase = nil; + SPClear(requestedPassphrase); } // Unlock the lock again @@ -747,8 +747,8 @@ if (identityFilePath) [identityFilePath release]; // As this object is not a NSWindowController, use manual top-level nib item management - if (sshQuestionDialog) [sshQuestionDialog release], sshQuestionDialog = nil; - if (sshPasswordDialog) [sshPasswordDialog release], sshPasswordDialog = nil; + if (sshQuestionDialog) SPClear(sshQuestionDialog); + if (sshPasswordDialog) SPClear(sshPasswordDialog); [super dealloc]; } |