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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user