Showing the changes to interface/src/Application.cpp (1 of 1 file). Show all
Unified · Split
| @@ -444,7 +444,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 443 unmodified lines | ||
| 444 | 444 | int SAVE_SETTINGS_INTERVAL = 10 * MSECS_PER_SECOND; // Let's save every seconds for now |
| 445 | 445 | connect(&_settingsTimer, &QTimer::timeout, this, &Application::saveSettings); |
| 446 | 446 | connect(&_settingsThread, SIGNAL(started()), &_settingsTimer, SLOT(start())); |
| 447 | − connect(&_settingsThread, &QThread::finished, &_settingsTimer, &QTimer::deleteLater); | |
| 447 | + connect(&_settingsThread, SIGNAL(finished()), &_settingsTimer, SLOT(stop())); | |
| 448 | 448 | _settingsTimer.moveToThread(&_settingsThread); |
| 449 | 449 | _settingsTimer.setSingleShot(false); |
| 450 | 450 | _settingsTimer.setInterval(SAVE_SETTINGS_INTERVAL); |
| @@ -470,6 +470,8 @@ void Application::aboutToQuit() { · 19 unmodified lines | ||
| 470 | 470 | } |
| 471 | 471 | |
| 472 | 472 | Application::~Application() { |
| 473 | + QMetaObject::invokeMethod(&_settingsTimer, "stop", Qt::BlockingQueuedConnection); | |
| 474 | + _settingsThread.quit(); | |
| 473 | 475 | saveSettings(); |
| 474 | 476 | |
| 475 | 477 | _entities.getTree()->setSimulation(NULL); |