Fix reference problem in InspectorWindow.
On quit, the inspector window needs to detach itself from its current block and release its reference. Otherwise the next attempt to inspect the same block will crash since it still contains the deleted window in its listener list. Also fixes leaking blocks.
This commit is contained in:
@@ -52,6 +52,11 @@ InspectorWindow::InspectorWindow(::Team* team, UserInterfaceListener* listener,
|
||||
|
||||
InspectorWindow::~InspectorWindow()
|
||||
{
|
||||
if (fCurrentBlock != NULL)
|
||||
{
|
||||
fCurrentBlock->RemoveListener(this);
|
||||
fCurrentBlock->ReleaseReference();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user