diff --git a/Source/GSFileHandle.m b/Source/GSFileHandle.m index dc4980265..c8cc9651c 100644 --- a/Source/GSFileHandle.m +++ b/Source/GSFileHandle.m @@ -351,19 +351,19 @@ static GSTcpTune *tune = nil; { if (self == fh_stdin) { - RETAIN(self); + fh_stdin = nil; [NSException raise: NSGenericException format: @"Attempt to deallocate standard input handle"]; } if (self == fh_stdout) { - RETAIN(self); + fh_stdout = nil; [NSException raise: NSGenericException format: @"Attempt to deallocate standard output handle"]; } if (self == fh_stderr) { - RETAIN(self); + fh_stderr = nil; [NSException raise: NSGenericException format: @"Attempt to deallocate standard error handle"]; } diff --git a/Tests/base/NSFileHandle/singleton.m b/Tests/base/NSFileHandle/singleton.m index 792632e69..ade40c848 100644 --- a/Tests/base/NSFileHandle/singleton.m +++ b/Tests/base/NSFileHandle/singleton.m @@ -15,15 +15,9 @@ int main(void) b = [NSFileHandle fileHandleWithStandardOutput]; c = [NSFileHandle fileHandleWithStandardError]; END_SET("handle creation") - PASS([a retainCount]> 0, "stdin persists"); - PASS([b retainCount]> 0, "stdout persists"); - PASS([c retainCount]> 0, "strerr persists"); PASS_EXCEPTION([a release], NSGenericException, "Cannot dealloc stdin"); PASS_EXCEPTION([b release], NSGenericException, "Cannot dealloc stdout"); PASS_EXCEPTION([c release], NSGenericException, "Cannot dealloc stderr"); - PASS([a retainCount]> 0, "stdin persists"); - PASS([b retainCount]> 0, "stdout persists"); - PASS([c retainCount]> 0, "strerr persists"); [p drain]; return 0;