提交 2fa208ad 编写于 作者: P Palana

Check if scene item is actually alive when calling obs_sceneitem_destroy

Prevents a double free in case the scene item was previously removed
上级 af03444c
......@@ -302,7 +302,16 @@ int obs_sceneitem_destroy(obs_scene_t scene, obs_sceneitem_t item)
pthread_mutex_lock(&scene->mutex);
if (item) {
bool found = false;
obs_sceneitem_t i = scene->first_item;
while (i) {
if (i == item) {
found = true;
break;
}
}
if (found) {
struct calldata params = {0};
signal_item_destroy(item, &params);
calldata_free(&params);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册