17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
#include "config.h"
#include <stdlib.h>
#include <string.h>
#ifndef _WIN32
# include <unistd.h>
# include <sys/wait.h>
#endif
#ifdef __MACH__
# include <crt_externs.h>
#endif
|
>
|
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
#include "config.h"
#include <stdlib.h>
#include <string.h>
#ifndef _WIN32
# include <unistd.h>
# include <signal.h>
# include <sys/wait.h>
#endif
#ifdef __MACH__
# include <crt_externs.h>
#endif
|
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
|
exceptionWithClass: [self class]];
} @finally {
[self freeMemory: argumentsCopy];
}
objc_autoreleasePoolPop(pool);
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
CloseHandle(readPipe[1]);
CloseHandle(writePipe[0]);
#endif
} @catch (id e) {
[self release];
|
|
|
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
|
exceptionWithClass: [self class]];
} @finally {
[self freeMemory: argumentsCopy];
}
objc_autoreleasePoolPop(pool);
process = pi.hProcess;
CloseHandle(pi.hThread);
CloseHandle(readPipe[1]);
CloseHandle(writePipe[0]);
#endif
} @catch (id e) {
[self release];
|
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
|
{
#ifndef _WIN32
if (readPipe[0] != -1)
close(readPipe[0]);
if (writePipe[1] != -1)
close(writePipe[1]);
if (pid != -1)
waitpid(pid, &status, WNOHANG);
pid = -1;
readPipe[0] = -1;
writePipe[1] = -1;
#else
if (readPipe[0] != NULL)
CloseHandle(readPipe[0]);
if (writePipe[1] != NULL)
CloseHandle(writePipe[1]);
readPipe[0] = NULL;
writePipe[1] = NULL;
#endif
}
@end
|
|
>
>
>
>
>
>
>
>
|
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
|
{
#ifndef _WIN32
if (readPipe[0] != -1)
close(readPipe[0]);
if (writePipe[1] != -1)
close(writePipe[1]);
if (pid != -1) {
kill(pid, SIGKILL);
waitpid(pid, &status, WNOHANG);
}
pid = -1;
readPipe[0] = -1;
writePipe[1] = -1;
#else
if (readPipe[0] != NULL)
CloseHandle(readPipe[0]);
if (writePipe[1] != NULL)
CloseHandle(writePipe[1]);
if (process != INVALID_HANDLE_VALUE) {
TerminateProcess(process, 0);
CloseHandle(process);
}
process = INVALID_HANDLE_VALUE;
readPipe[0] = NULL;
writePipe[1] = NULL;
#endif
}
@end
|