Merge pull request #6684 from spycrab/qt_wrong_thread

Qt/Settings: Emit EmulationStateChanged from the UI thread
This commit is contained in:
Pierre Bourdon 2018-04-22 15:36:32 +02:00 committed by GitHub
commit 1b63810e85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -20,8 +20,9 @@
Settings::Settings() Settings::Settings()
{ {
qRegisterMetaType<Core::State>(); qRegisterMetaType<Core::State>();
Core::SetOnStateChangedCallback( Core::SetOnStateChangedCallback([this](Core::State new_state) {
[this](Core::State new_state) { emit EmulationStateChanged(new_state); }); QueueOnObject(this, [this, new_state] { emit EmulationStateChanged(new_state); });
});
Config::AddConfigChangedCallback( Config::AddConfigChangedCallback(
[this] { QueueOnObject(this, [this] { emit ConfigChanged(); }); }); [this] { QueueOnObject(this, [this] { emit ConfigChanged(); }); });