aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Drop Serve/Server.m7
1 files changed, 6 insertions, 1 deletions
diff --git a/Drop Serve/Server.m b/Drop Serve/Server.m
index 21da986..ad6146b 100644
--- a/Drop Serve/Server.m
+++ b/Drop Serve/Server.m
@@ -12,6 +12,8 @@
+ (void)serveAtPath:(NSString *)path
{
+ [self stop];
+
_process = [[NSTask alloc] init];
[_process setCurrentDirectoryPath:path];
[_process setLaunchPath:@"/usr/bin/python"];
@@ -27,7 +29,10 @@
+ (void)stop
{
- [_process terminate];
+ if ([_process isRunning]) {
+ [_process terminate];
+ }
+
[_process dealloc];
}