From bbbe023af3dbd927833cd006a6377ce7e96f4c44 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Tue, 25 Jun 2013 18:03:49 -0400 Subject: [PATCH] InspectorWindow: slight behaviorial tweak in failure case. Don't release the reference to the current block until we get the notification that the next block has been retrieved. Otherwise, the previous/next block buttons would cease to work if the requested block failed to be retrieved. --- .../gui/inspector_window/InspectorWindow.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/apps/debugger/user_interface/gui/inspector_window/InspectorWindow.cpp b/src/apps/debugger/user_interface/gui/inspector_window/InspectorWindow.cpp index 333fa3065c..f674ff3d1f 100644 --- a/src/apps/debugger/user_interface/gui/inspector_window/InspectorWindow.cpp +++ b/src/apps/debugger/user_interface/gui/inspector_window/InspectorWindow.cpp @@ -221,15 +221,10 @@ InspectorWindow::MessageReceived(BMessage* message) if (addressValid) { fCurrentAddress = address; - if (fCurrentBlock != NULL - && !fCurrentBlock->Contains(address)) { - fCurrentBlock->ReleaseReference(); - fCurrentBlock = NULL; - } - - if (fCurrentBlock == NULL) + if (fCurrentBlock == NULL + || !fCurrentBlock->Contains(address)) { fListener->InspectRequested(address, this); - else + } else fMemoryView->SetTargetAddress(fCurrentBlock, address); } break; @@ -266,6 +261,9 @@ InspectorWindow::MessageReceived(BMessage* message) } if (result == B_OK) { + if (fCurrentBlock != NULL) + fCurrentBlock->ReleaseReference(); + fCurrentBlock = block; fMemoryView->SetTargetAddress(block, fCurrentAddress); fPreviousBlockButton->SetEnabled(true);