libcamera: v4l2_subdevice: Close subdevice when destroyed
Make sure the subdevice file descriptor isn't leaked by closing it when the V4L2Subdevice instance is destroyed. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
@@ -112,6 +112,11 @@ V4L2Subdevice::V4L2Subdevice(const MediaEntity *entity)
|
||||
{
|
||||
}
|
||||
|
||||
V4L2Subdevice::~V4L2Subdevice()
|
||||
{
|
||||
close();
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Open a V4L2 subdevice
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user