Fix crash when use Windows/Close option.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2018-01-06 12:09:06 +02:00
parent fdd7f6c2a3
commit 231780d35e

View file

@ -2884,6 +2884,7 @@ void MainWindow::Clear()
qCDebug(vMainWindow, "Unlocked pattern file.");
ActionDraw(true);
qCDebug(vMainWindow, "Returned to Draw mode.");
setCurrentFile(QString());// Keep before cleaning a pattern data to prevent a crash
pattern->Clear();
qCDebug(vMainWindow, "Clearing pattern.");
if (not qApp->GetPPath().isEmpty() && not doc->MPath().isEmpty())
@ -2891,7 +2892,6 @@ void MainWindow::Clear()
watcher->removePath(AbsoluteMPath(qApp->GetPPath(), doc->MPath()));
}
doc->clear();
setCurrentFile(QString());
qCDebug(vMainWindow, "Clearing scenes.");
sceneDraw->clear();
sceneDetails->clear();