Skip to content

Commit

Permalink
Fix double free of scene source (causes corruption like removal of sc…
Browse files Browse the repository at this point in the history
…enes and eventually crashes OBS)
  • Loading branch information
vwout committed Feb 5, 2024
1 parent dbd86e5 commit 46616b6
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions obs-visca-control.lua
Expand Up @@ -350,13 +350,15 @@ local function get_plugin_settings_from_scene(scene_type, camera_id)
obs.obs_frontend_get_current_preview_scene()
elseif type(scene_type) == "string" then
local scenes = obs.obs_frontend_get_scenes()
for _, eval_scene in pairs(scenes) do
if scene_type == obs.obs_source_get_name(eval_scene) then
scene_source = eval_scene
break
if scenes ~= nil then
for _, eval_scene in pairs(scenes) do
if scene_type == obs.obs_source_get_name(eval_scene) then
scene_source = obs.obs_source_get_ref(eval_scene)
break
end
end
obs.source_list_release(scenes)
end
obs.source_list_release(scenes)
end

if scene_source ~= nil then
Expand Down

0 comments on commit 46616b6

Please sign in to comment.