1
0
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:
Anthony Bilinski 2018-09-12 18:38:15 -07:00
parent ffbcbddcaf
commit 7839a26083
No known key found for this signature in database
GPG Key ID: 2AA8E0DA1B31FB3C

View File

@ -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();