@@ -24,19 +24,20 @@ #endif #import "OFProcess.h" #import "OFString.h" #import "OFArray.h" -#import "OFAutoreleasePool.h" #import "OFInitializationFailedException.h" #import "OFReadFailedException.h" #import "OFWriteFailedException.h" #ifdef _WIN32 # include #endif + +#import "autorelease.h" @implementation OFProcess + processWithProgram: (OFString*)program { return [[[self alloc] initWithProgram: program] autorelease]; @@ -123,11 +124,11 @@ } #else SECURITY_ATTRIBUTES sa; PROCESS_INFORMATION pi; STARTUPINFO si; - OFAutoreleasePool *pool; + void *pool; OFMutableString *argumentsString; OFEnumerator *enumerator; OFString *argument; char *argumentsCString; @@ -158,11 +159,11 @@ si.hStdInput = writePipe[0]; si.hStdOutput = readPipe[1]; si.hStdError = GetStdHandle(STD_ERROR_HANDLE); si.dwFlags |= STARTF_USESTDHANDLES; - pool = [[OFAutoreleasePool alloc] init]; + pool = objc_autoreleasePoolPush(); argumentsString = [OFMutableString stringWithString: programName]; [argumentsString replaceOccurrencesOfString: @"\\\"" withString: @"\\\\\""]; @@ -206,11 +207,11 @@ exceptionWithClass: [self class]]; } @finally { free(argumentsString); } - [pool release]; + objc_autoreleasePoolPop(pool); CloseHandle(pi.hProcess); CloseHandle(pi.hThread); CloseHandle(readPipe[1]);