From 674bc405892293408a69490937a59e102bf8ffc1 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Sat, 3 Nov 2012 23:00:40 +0100 Subject: [PATCH] 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. --- .../user_interface/gui/inspector_window/InspectorWindow.cpp | 5 +++++ 1 file changed, 5 insertions(+) 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 5d2893258d..5dbb1083aa 100644 --- a/src/apps/debugger/user_interface/gui/inspector_window/InspectorWindow.cpp +++ b/src/apps/debugger/user_interface/gui/inspector_window/InspectorWindow.cpp @@ -52,6 +52,11 @@ InspectorWindow::InspectorWindow(::Team* team, UserInterfaceListener* listener, InspectorWindow::~InspectorWindow() { + if (fCurrentBlock != NULL) + { + fCurrentBlock->RemoveListener(this); + fCurrentBlock->ReleaseReference(); + } }