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.
This commit is contained in:
Michael Lotz 2011-12-12 00:22:07 +01:00
parent d86197cec3
commit fe10dd20bf

View File

@ -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();