Skip to content

Commit dbd86e5

Browse files
committed
Fix memory leak (missing release of source settings)
1 parent a073d9a commit dbd86e5

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

obs-visca-control.lua

+7-3
Original file line numberDiff line numberDiff line change
@@ -1219,11 +1219,15 @@ local function source_signal_processor(source_settings, source_name, signal)
12191219
if program_scene_active and current_program_scene_name ~= program_scene_name then
12201220
for _, program_source_name, program_source_settings, program_source_is_visible in
12211221
get_plugin_settings_from_scene(program_scene_name, camera_id) do
1222-
if program_source_is_visible then
1222+
if program_source_settings ~= nil and program_source_is_visible then
12231223
log("Run shutdown action for scene '%s' source '%s' (camera %d) before activation of '%s'",
12241224
program_scene_name, program_source_name, camera_id, current_program_scene_name)
12251225
do_cam_scene_action(program_source_settings, scene_action_at.Stop)
12261226
end
1227+
1228+
if program_source_settings ~= nil then
1229+
obs.obs_data_release(program_source_settings)
1230+
end
12271231
end
12281232

12291233
-- Set the program scene for which stop actions are already executed to false
@@ -1314,12 +1318,12 @@ local function fe_callback(event, data)
13141318

13151319
-- Activate the Visca sources in the now visible scene
13161320
if activate_sources then
1317-
if source_settings and source_is_visible then
1321+
if source_settings ~= nil and source_is_visible then
13181322
source_signal_processor(source_settings, source_name, { show_fe_event = true })
13191323
end
13201324
end
13211325

1322-
if source_settings then
1326+
if source_settings ~= nil then
13231327
obs.obs_data_release(source_settings)
13241328
end
13251329
end

0 commit comments

Comments
 (0)