diff options
author | Barnabás Pőcze <pobrn@protonmail.com> | 2023-04-15 21:03:40 +0000 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2023-04-18 10:41:51 +0300 |
commit | f99b0f7f8f51e13618b4aededf1564af803d28da (patch) | |
tree | 89905161153c6e12e8168595f4eefbfd121fd141 | |
parent | 98fc381c68a372b78260b2940411a64ea9e5011c (diff) |
libcamera: device_enumerator_udev: Remove devnum from dependency map
Previously, after `addV4L2Device()` had seen all dependecies, it would
remove the `MediaDeviceDeps` object from the `pending_` list, which
would result in it being destroyed. However, there would still be
(dangling) pointers to this object in `devMap_` that were added in
`addUdevDevice()` (line 103). So remove the entry with the given devnum
when it is removed from the corresponding `MediaDeviceDeps` object.
Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rw-r--r-- | src/libcamera/device_enumerator_udev.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libcamera/device_enumerator_udev.cpp b/src/libcamera/device_enumerator_udev.cpp index 5317afbd..a63cd360 100644 --- a/src/libcamera/device_enumerator_udev.cpp +++ b/src/libcamera/device_enumerator_udev.cpp @@ -315,6 +315,7 @@ int DeviceEnumeratorUdev::addV4L2Device(dev_t devnum) * enumerator. */ deps->deps_.erase(devnum); + devMap_.erase(it); if (deps->deps_.empty()) { LOG(DeviceEnumerator, Debug) |