Skip to content

Commit

Permalink
UI: Handle (de)select scene items queued
Browse files Browse the repository at this point in the history
The (de)select signal can come from a obs_scene_enum_items
which locks the scene. The Qt::QueuedConnection makes sure
the (de)select is handled outside of that lock.
Fixes the deadlock from #3673
  • Loading branch information
exeldro authored and jp9000 committed Dec 12, 2020
1 parent 3a1af9c commit d68484e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions UI/source-tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ void SourceTreeItem::ReconnectSignals()
(obs_sceneitem_t *)calldata_ptr(cd, "item");

if (curItem == this_->sceneitem)
QMetaObject::invokeMethod(this_, "Select");
QMetaObject::invokeMethod(this_, "Select",
Qt::QueuedConnection);
};

auto itemDeselect = [](void *data, calldata_t *cd) {
Expand All @@ -237,7 +238,8 @@ void SourceTreeItem::ReconnectSignals()
(obs_sceneitem_t *)calldata_ptr(cd, "item");

if (curItem == this_->sceneitem)
QMetaObject::invokeMethod(this_, "Deselect");
QMetaObject::invokeMethod(this_, "Deselect",
Qt::QueuedConnection);
};

auto reorderGroup = [](void *data, calldata_t *) {
Expand Down

0 comments on commit d68484e

Please sign in to comment.