From b1e891055c5e4a175e7550e046474a8d19e2b0ab Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Mon, 28 Feb 2011 08:45:03 -0500 Subject: [PATCH] In NetworkCallbackController::Unschedule*Stream(), don't proceed if the streams are NULL. --- CHANGES | 1 + Source/NetworkCallbackController.mm | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CHANGES b/CHANGES index 226579d..c4d3ab9 100644 --- a/CHANGES +++ b/CHANGES @@ -11,6 +11,7 @@ MacGDBp CHANGE LOG 1.4.1 ##################### - Fix: Objects with nested objects wouldn't always load their child keys +- Fix: #213 Crash when unchecking "Attached" when the debugger is inactive 1.4 Beta 2 diff --git a/Source/NetworkCallbackController.mm b/Source/NetworkCallbackController.mm index 73c032a..a9c4cb3 100644 --- a/Source/NetworkCallbackController.mm +++ b/Source/NetworkCallbackController.mm @@ -213,6 +213,8 @@ void NetworkCallbackController::OnWriteStreamEvent(CFWriteStreamRef stream, void NetworkCallbackController::UnscheduleReadStream() { + if (!connection_.readStream) + return; CFReadStreamUnscheduleFromRunLoop(connection_.readStream, runLoop_, kCFRunLoopCommonModes); CFReadStreamClose(connection_.readStream); CFRelease(connection_.readStream); @@ -221,6 +223,8 @@ void NetworkCallbackController::UnscheduleReadStream() void NetworkCallbackController::UnscheduleWriteStream() { + if (!connection_.writeStream) + return; CFWriteStreamUnscheduleFromRunLoop(connection_.writeStream, runLoop_, kCFRunLoopCommonModes); CFWriteStreamClose(connection_.writeStream); CFRelease(connection_.writeStream); -- 2.43.5