提交 19068c29 编写于 作者: J jp9000

libobs: Handle removed plugins for versioned sources

When someone adds a source and the plugin is removed for whatever
reason, it would cause a crash with the new source versioning system.
This fixes that by ensuring the unversioned id is also backed up along
with the normal id.
上级 8d5ab2be
......@@ -341,6 +341,7 @@ obs_source_create_internal(const char *id, const char *name,
source->info.id = bstrdup(id);
source->owns_info_id = true;
source->info.unversioned_id = bstrdup(source->info.id);
} else {
source->info = *info;
......@@ -661,8 +662,10 @@ void obs_source_destroy(struct obs_source *source)
obs_data_release(source->private_settings);
obs_context_data_free(&source->context);
if (source->owns_info_id)
if (source->owns_info_id) {
bfree((void *)source->info.id);
bfree((void *)source->info.unversioned_id);
}
bfree(source);
}
......
......@@ -1839,6 +1839,10 @@ static obs_source_t *obs_load_source_type(obs_data_t *source_data)
source = obs_source_create_set_last_ver(v_id, name, settings, hotkeys,
prev_ver);
if (source->owns_info_id) {
bfree((void *)source->info.unversioned_id);
source->info.unversioned_id = bstrdup(id);
}
obs_data_release(hotkeys);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册