Fix a crash when changing stack frames after disconnecting.
authorRobert Sesek <rsesek@bluestatic.org>
Sun, 12 Apr 2020 16:02:56 +0000 (12:02 -0400)
committerRobert Sesek <rsesek@bluestatic.org>
Sun, 12 Apr 2020 16:02:56 +0000 (12:02 -0400)
This was hitting:
Assertion failed: (_messageQueue), function -[ProtocolClient sendCommandWithFormat:handler:], file /Users/rsesek/Projects/MacGDBp/Source/ProtocolClient.m, line 85.

CHANGES
Source/DebuggerBackEnd.m
Source/DebuggerController.m

diff --git a/CHANGES b/CHANGES
index 4bd0c0c53af30c8ef830c19ca54d3bac22dc183c..deb1db62f7ee0d57f45470ebd171c04da9deba27 100644 (file)
--- 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.
index 6f8c3ca0ef504b2bd5e6e304ce4b574737a11e8a..bbdb0456c2bc87ac10abc1b1f954c2a1d7969b04 100644 (file)
 - (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]) {
index 67875d888a103a0ad084341e66533b68af9f732f..a34a6b60a17191606896f2e52625d7fdbfaf5734 100644 (file)
     NSLog(@"INVALID SELECTION");
   StackFrame* frame = [selection objectAtIndex:0];
 
-  if (!frame.loaded) {
+  if (!frame.loaded && self.model.connected) {
     [_connection loadStackFrame:frame];
     return;
   }