mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-21 23:55:07 +03:00
qcam: Fix camera reference leak on hot-unplug
If the currently streaming camera is hot-unplugged, a camera reference was still held by MainWindow::camera_, preventing it to be destructed, until qcam window is closed. Plug the leak in the hot-unplug handler itself. Signed-off-by: Umang Jain <email@uajain.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
e349cb0f8a
commit
c8edfe29c1
1 changed files with 2 additions and 0 deletions
|
@ -587,6 +587,8 @@ void MainWindow::processHotplug(HotplugEvent *e)
|
||||||
/* Check if the currently-streaming camera is removed. */
|
/* Check if the currently-streaming camera is removed. */
|
||||||
if (camera == camera_.get()) {
|
if (camera == camera_.get()) {
|
||||||
toggleCapture(false);
|
toggleCapture(false);
|
||||||
|
camera_->release();
|
||||||
|
camera_.reset();
|
||||||
cameraCombo_->setCurrentIndex(0);
|
cameraCombo_->setCurrentIndex(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue