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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user