diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2019-04-17 00:37:40 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2019-04-18 18:13:15 +0300 |
commit | d97cafdf3c60afb75fa38d8b2f17b816c934ad9d (patch) | |
tree | 6b38e0f7384c6eef31eebc60f7f6ac732a994fa6 /src/libcamera/v4l2_subdevice.cpp | |
parent | 889b70d62d1b2fa974951866cb8bbebe66fce3a7 (diff) |
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>
Diffstat (limited to 'src/libcamera/v4l2_subdevice.cpp')
-rw-r--r-- | src/libcamera/v4l2_subdevice.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp index e34cc169..a03fadfd 100644 --- a/src/libcamera/v4l2_subdevice.cpp +++ b/src/libcamera/v4l2_subdevice.cpp @@ -112,6 +112,11 @@ V4L2Subdevice::V4L2Subdevice(const MediaEntity *entity) { } +V4L2Subdevice::~V4L2Subdevice() +{ + close(); +} + /** * \brief Open a V4L2 subdevice * |