diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2019-02-28 12:39:46 +0200 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2019-03-01 15:26:03 +0200 |
commit | e6eff721d7f341eb0c45e58f908bf3129c427b27 (patch) | |
tree | a6fa696a18aa45337c1d81fdfdd29ffee5d611ad /src/libcamera/pipeline/vimc.cpp | |
parent | 3ab7f65d6f1be61b64bf66a3a7959004cf82dc10 (diff) |
libcamera: pipeline: Fix double release of media devices
Media devices are acquired in the match() function of pipeline handlers,
and explicitly released if no match is found. The pipeline handler is
then deleted, which causes a second release of the media device in the
destructor. Fix this by removing the explicit release in the match()
function.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Acked-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'src/libcamera/pipeline/vimc.cpp')
-rw-r--r-- | src/libcamera/pipeline/vimc.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/libcamera/pipeline/vimc.cpp b/src/libcamera/pipeline/vimc.cpp index 9ba96323..3b2fcbd8 100644 --- a/src/libcamera/pipeline/vimc.cpp +++ b/src/libcamera/pipeline/vimc.cpp @@ -165,11 +165,8 @@ bool PipelineHandlerVimc::match(DeviceEnumerator *enumerator) media_->acquire(); video_ = new V4L2Device(media_->getEntityByName("Raw Capture 1")); - - if (video_->open()) { - media_->release(); + if (video_->open()) return false; - } std::set<Stream *> streams{ &stream_ }; std::shared_ptr<Camera> camera = Camera::create(this, "VIMC Sensor B", |