Avoid ASSERT() fail in ~DocObserverWidget()

We have to unselect all documents before we destroy the main window,
so all onActiveSiteChange()/onDocChange() are called correctly just in
case.
This commit is contained in:
David Capello 2019-06-04 16:45:59 -03:00
parent 29a6f89dc4
commit 7c26a88813

View File

@ -407,8 +407,11 @@ void App::run()
#ifdef ENABLE_UI
if (isGui()) {
// Select no document
m_modules->m_context.setActiveView(nullptr);
// Destroy the window.
m_mainWindow.reset(NULL);
m_mainWindow.reset(nullptr);
// Delete backups (this is a normal shutdown, we are not handling
// exceptions, and we are not in a destructor).