From 8604e88a9c744318dabe825d77240fc6fe669d68 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 31 Oct 2010 13:33:35 -0400 Subject: [PATCH] Properly quit the run loop. For some reason, calling -[NSRunLoop run] doesn't work with CFRunLoopStop(). Activate it with CFRunLoopRun() instead. --- Source/DebuggerConnection.m | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Source/DebuggerConnection.m b/Source/DebuggerConnection.m index 598c3c1..8424782 100644 --- a/Source/DebuggerConnection.m +++ b/Source/DebuggerConnection.m @@ -294,7 +294,7 @@ void PerformQuitSignal(void* info) quitSource_ = CFRunLoopSourceCreate(kCFAllocatorDefault, 0, &quitContext); CFRunLoopAddSource([runLoop_ getCFRunLoop], quitSource_, kCFRunLoopCommonModes); - [runLoop_ run]; + CFRunLoopRun(); thread_ = nil; runLoop_ = nil; @@ -324,6 +324,9 @@ void PerformQuitSignal(void* info) */ - (void)close { + if (thread_) { + [thread_ cancel]; + } if (runLoop_ && quitSource_) { CFRunLoopSourceSignal(quitSource_); CFRunLoopWakeUp([runLoop_ getCFRunLoop]); @@ -335,6 +338,10 @@ void PerformQuitSignal(void* info) */ - (void)performQuitSignal { + self.queuedWrites = nil; + connected_ = NO; + [writeQueueLock_ release]; + if (runLoop_) { CFRunLoopStop([runLoop_ getCFRunLoop]); } @@ -345,10 +352,6 @@ void PerformQuitSignal(void* info) CFRelease(socket_); socket_ = NULL; } - - self.queuedWrites = nil; - connected_ = NO; - [writeQueueLock_ release]; } /** -- 2.43.5