From fe10dd20bf40a3c48d10d342197694c5e7a767d3 Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Mon, 12 Dec 2011 00:22:07 +0100 Subject: [PATCH] Fix indirect use of fState after deleting it. Calling SetIcon(NULL) calls MakeEmpty() that tries to delete all manipulators on fState. So we may only delete fState after that call. Also reported as CID 10856. --- src/apps/icon-o-matic/MainWindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/apps/icon-o-matic/MainWindow.cpp b/src/apps/icon-o-matic/MainWindow.cpp index 3e5242e1e8..85190453ec 100644 --- a/src/apps/icon-o-matic/MainWindow.cpp +++ b/src/apps/icon-o-matic/MainWindow.cpp @@ -126,10 +126,10 @@ MainWindow::MainWindow(BRect frame, IconEditorApp* app, MainWindow::~MainWindow() { - delete fState; - SetIcon(NULL); + delete fState; + // Make sure there are no listeners attached to the document anymore. while (BView* child = ChildAt(0L)) { child->RemoveSelf();