mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
fix(settings): save settings early on Windows shutdown
Need to save before top level window is closed. Fix #1969
This commit is contained in:
parent
ffbcbddcaf
commit
7839a26083
|
@ -59,6 +59,15 @@ QMutex* logBufferMutex = new QMutex();
|
|||
|
||||
void cleanup()
|
||||
{
|
||||
// force save early even though destruction saves, because Windows OS will
|
||||
// close qTox before cleanup() is finished if logging out or shutting down,
|
||||
// once the top level window has exited, which occurs in ~Widget within
|
||||
// ~Nexus. Re-ordering Nexus destruction is not trivial.
|
||||
auto& s = Settings::getInstance();
|
||||
s.saveGlobal();
|
||||
s.savePersonal();
|
||||
s.sync();
|
||||
|
||||
Nexus::destroyInstance();
|
||||
CameraSource::destroyInstance();
|
||||
Settings::destroyInstance();
|
||||
|
|
Loading…
Reference in New Issue
Block a user