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
This commit is contained in:
George Kiagiadakis
2024-05-23 12:35:23 +03:00
parent 4ed51791e0
commit 2811d46a38

View File

@@ -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