提交 7bb430ef 编写于 作者: P Palana

UI: Clean up sourceSceneRefs when removing scenes

Previously the sourceSceneRefs were being cleaned up in
OBSBasic::SceneItemRemoved; due to changes in
e8201857 the signal handler that called
OBSBasic::SceneItemRemoved is now being removed before the scene
triggers its item_remove signals
上级 9f2566fe
......@@ -1250,6 +1250,25 @@ void OBSBasic::RemoveScene(OBSSource source)
delete sel;
}
auto DeleteSceneRefs = [&](obs_sceneitem_t *si)
{
obs_source_t *source = obs_sceneitem_get_source(si);
sourceSceneRefs[source] -= 1;
if (!sourceSceneRefs[source]) {
obs_source_remove(source);
sourceSceneRefs.erase(source);
}
};
using DeleteSceneRefs_t = decltype(DeleteSceneRefs);
obs_scene_enum_items(obs_scene_from_source(source),
[](obs_scene_t *, obs_sceneitem_t *si, void *data)
{
(*static_cast<DeleteSceneRefs_t*>(data))(si);
return true;
}, static_cast<void*>(&DeleteSceneRefs));
SaveProject();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册