From: Manuel Nickschas Date: Sat, 29 Sep 2018 09:52:12 +0000 (+0200) Subject: qtui: Fix quit sequence and lifetime issues X-Git-Tag: 0.13-rc2~11 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=72473527f99cbe68dcfcb4ca17f828bd3775bba7;hp=72473527f99cbe68dcfcb4ca17f828bd3775bba7 qtui: Fix quit sequence and lifetime issues Make use of the Singleton mixin for Client and GraphicalUi. Fix ownership and explicitly construct and destroy the pseudo singletons. Remove some static init methods in favor of initializing in the constructor where possible. We still need delayed initialization of the main UI however, so GraphicalUi::init() has to stay. Simply calling QCoreApplication::quit() doesn't clean up properly, because it immediately stops event processing, which means that any deferred deletions won't be processed anymore. Since we perform some important and asynchronous tasks during shutdown, such as saving settings and properly unregistering from IRC, we really want proper cleanup, though. Fix this by relying on Quassel::quit() instead, and registering appropriate quit handlers that shut down the client in orderly and controlled fashion. Ensure that all open windows and dialogs are closed prior to MainWin's destruction. Core shutdown warrants a more complex approach, which will be implemented in a follow-up commit. ---