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.
This commit is contained in:
Rene Gollent
2013-06-25 18:03:49 -04:00
parent b906e10a5d
commit bbbe023af3
@@ -221,15 +221,10 @@ InspectorWindow::MessageReceived(BMessage* message)
if (addressValid) { if (addressValid) {
fCurrentAddress = address; fCurrentAddress = address;
if (fCurrentBlock != NULL if (fCurrentBlock == NULL
&& !fCurrentBlock->Contains(address)) { || !fCurrentBlock->Contains(address)) {
fCurrentBlock->ReleaseReference();
fCurrentBlock = NULL;
}
if (fCurrentBlock == NULL)
fListener->InspectRequested(address, this); fListener->InspectRequested(address, this);
else } else
fMemoryView->SetTargetAddress(fCurrentBlock, address); fMemoryView->SetTargetAddress(fCurrentBlock, address);
} }
break; break;
@@ -266,6 +261,9 @@ InspectorWindow::MessageReceived(BMessage* message)
} }
if (result == B_OK) { if (result == B_OK) {
if (fCurrentBlock != NULL)
fCurrentBlock->ReleaseReference();
fCurrentBlock = block; fCurrentBlock = block;
fMemoryView->SetTargetAddress(block, fCurrentAddress); fMemoryView->SetTargetAddress(block, fCurrentAddress);
fPreviousBlockButton->SetEnabled(true); fPreviousBlockButton->SetEnabled(true);