From 2811d46a38a3ba30e1adb4a9c5418b740d8b7369 Mon Sep 17 00:00:00 2001 From: George Kiagiadakis Date: Thu, 23 May 2024 12:35:23 +0300 Subject: [PATCH] monitor-utils: make cam_api_data a local variable Otherwise it is global and it retains a reference to the `parent` WpSpaDevice object until this function is called again, which prevents some camera nodes - in some cases - from being destroyed Fixes #640 --- src/scripts/lib/monitor-utils.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scripts/lib/monitor-utils.lua b/src/scripts/lib/monitor-utils.lua index 3503b1c7..5a79aaca 100644 --- a/src/scripts/lib/monitor-utils.lua +++ b/src/scripts/lib/monitor-utils.lua @@ -161,7 +161,7 @@ function mutils.register_cam_node (self, parent, id, factory, properties) cam_data.dev_path = properties["api.v4l2.path"] end - cam_api_data = cam_data[api] + local cam_api_data = cam_data[api] cam_api_data.enum_status = true -- cache info, it comes handy when creating node