From 64ebe659927a7d72828afed5d9d7ebd69220a179 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 12 Apr 2020 12:02:56 -0400 Subject: [PATCH] Fix a crash when changing stack frames after disconnecting. This was hitting: Assertion failed: (_messageQueue), function -[ProtocolClient sendCommandWithFormat:handler:], file /Users/rsesek/Projects/MacGDBp/Source/ProtocolClient.m, line 85. --- CHANGES | 4 ++++ Source/DebuggerBackEnd.m | 2 ++ Source/DebuggerController.m | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 4bd0c0c..deb1db6 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ MacGDBp CHANGE LOG ================================================================================ +2.0.2 +##################### +- Fix: Crash when selecting stack frames after disconnecting. + 2.0.1 ##################### - Change: Draw the source view gutter in a way that is dark-mode compatible. diff --git a/Source/DebuggerBackEnd.m b/Source/DebuggerBackEnd.m index 6f8c3ca..bbdb045 100644 --- a/Source/DebuggerBackEnd.m +++ b/Source/DebuggerBackEnd.m @@ -126,6 +126,8 @@ - (void)loadStackFrame:(StackFrame*)frame { if (frame.loaded) return; + if (!self.model.connected) + return; // Get the source code of the file. Escape % in URL chars. if ([frame.filename length]) { diff --git a/Source/DebuggerController.m b/Source/DebuggerController.m index 67875d8..a34a6b6 100644 --- a/Source/DebuggerController.m +++ b/Source/DebuggerController.m @@ -326,7 +326,7 @@ NSLog(@"INVALID SELECTION"); StackFrame* frame = [selection objectAtIndex:0]; - if (!frame.loaded) { + if (!frame.loaded && self.model.connected) { [_connection loadStackFrame:frame]; return; } -- 2.43.5