WIP: further refactoring.

This commit is contained in:
Matthias Koefferlein 2020-02-09 01:35:44 +01:00
parent a44535e009
commit e8a875ccb5
3 changed files with 9 additions and 9 deletions

View File

@ -1412,6 +1412,14 @@ GuiApplication::exec ()
void
GuiApplication::shutdown ()
{
// avoid deferred execution later on where there isn't a valid main window anymore
// (problem case: showing a dialog inside main windows's destroyed signal - this will
// process events and trigger execution if not disabled)
if (! tl::DeferredMethodScheduler::instance ()->is_disabled ()) {
tl::DeferredMethodScheduler::instance ()->execute ();
}
tl::DeferredMethodScheduler::instance ()->enable (false);
if (mp_mw) {
delete mp_mw;
mp_mw = 0;

View File

@ -692,14 +692,6 @@ MainWindow::MainWindow (QApplication *app, lay::Plugin *plugin_parent, const cha
MainWindow::~MainWindow ()
{
// avoid deferred execution later on where there isn't a valid main window anymore
// (problem case: showing a dialog inside main windows's destroyed signal - this will
// process events and trigger execution if not disabled)
if (! tl::DeferredMethodScheduler::instance ()->is_disabled ()) {
tl::DeferredMethodScheduler::instance ()->execute ();
}
tl::DeferredMethodScheduler::instance ()->enable (false);
lay::register_help_handler (0, 0, 0);
// since the configuration actions unregister themselves, we need to do this before the main

View File

@ -38,7 +38,7 @@ Dispatcher::Dispatcher (Plugin *parent, bool standalone)
: Plugin (parent, standalone),
m_menu (this)
{
if (! parent) {
if (! parent && ! ms_dispatcher_instance) {
ms_dispatcher_instance = this;
}
}