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:
Rene Gollent
2012-11-04 09:09:44 +01:00
parent a6de493213
commit 674bc40589
@@ -52,6 +52,11 @@ InspectorWindow::InspectorWindow(::Team* team, UserInterfaceListener* listener,
InspectorWindow::~InspectorWindow()
{
if (fCurrentBlock != NULL)
{
fCurrentBlock->RemoveListener(this);
fCurrentBlock->ReleaseReference();
}
}