History

Fix QTimer warning

Atlante45 committed 11 years ago

Commit 375d9ee1 parent 78a9d001 file · +3 −1Browse files

Showing the changes to interface/src/Application.cpp (1 of 1 file). Show all

Unified · Split

interface/src/Application.cpp+3−1
@@ -444,7 +444,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 443 unmodified lines
444444 int SAVE_SETTINGS_INTERVAL = 10 * MSECS_PER_SECOND; // Let's save every seconds for now
445445 connect(&_settingsTimer, &QTimer::timeout, this, &Application::saveSettings);
446446 connect(&_settingsThread, SIGNAL(started()), &_settingsTimer, SLOT(start()));
447− connect(&_settingsThread, &QThread::finished, &_settingsTimer, &QTimer::deleteLater);
447+ connect(&_settingsThread, SIGNAL(finished()), &_settingsTimer, SLOT(stop()));
448448 _settingsTimer.moveToThread(&_settingsThread);
449449 _settingsTimer.setSingleShot(false);
450450 _settingsTimer.setInterval(SAVE_SETTINGS_INTERVAL);
@@ -470,6 +470,8 @@ void Application::aboutToQuit() { · 19 unmodified lines
470470 }
471471
472472 Application::~Application() {
473+ QMetaObject::invokeMethod(&_settingsTimer, "stop", Qt::BlockingQueuedConnection);
474+ _settingsThread.quit();
473475 saveSettings();
474476
475477 _entities.getTree()->setSimulation(NULL);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t