libcamera: device_enumerator_udev: Initialize monitor_ and notifier_ to nullptr
The monitor_ and notifier_ pointers are acted on in the destructor if not set to nullptr, the pointers are however first initialized in init() and enumerate(). Avoid acting on uninitialized pointers by initializing them to nullptr in the constructor. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <email@uajain.com>
This commit is contained in:
@@ -27,7 +27,7 @@ namespace libcamera {
|
||||
LOG_DECLARE_CATEGORY(DeviceEnumerator)
|
||||
|
||||
DeviceEnumeratorUdev::DeviceEnumeratorUdev()
|
||||
: udev_(nullptr)
|
||||
: udev_(nullptr), monitor_(nullptr), notifier_(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user