Browse Source

fix(settings): save settings early on Windows shutdown

Need to save before top level window is closed.

Fix #1969
pull/5338/head
Anthony Bilinski 7 years ago
parent
commit
7839a26083
No known key found for this signature in database
GPG Key ID: 2AA8E0DA1B31FB3C
  1. 9
      src/main.cpp

9
src/main.cpp

@ -59,6 +59,15 @@ QMutex* logBufferMutex = new QMutex(); @@ -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…
Cancel
Save