From ab9f3f089c6f9537ae316697ee151ad63c6618fd Mon Sep 17 00:00:00 2001 From: Val Doroshchuk Date: Thu, 4 Oct 2018 15:41:48 +0200 Subject: DirectShow: Fix crash when camera destroyed The lambda function is called even if the object is destroyed. Task-number: QTBUG-70932 Change-Id: I070059bd61769a6864a2848f2b537609577769de Reviewed-by: Oliver Wolff --- src/plugins/directshow/camera/dscameracontrol.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins/directshow/camera/dscameracontrol.cpp') diff --git a/src/plugins/directshow/camera/dscameracontrol.cpp b/src/plugins/directshow/camera/dscameracontrol.cpp index 7a2b46a2c..daf104e1c 100644 --- a/src/plugins/directshow/camera/dscameracontrol.cpp +++ b/src/plugins/directshow/camera/dscameracontrol.cpp @@ -51,7 +51,7 @@ DSCameraControl::DSCameraControl(QObject *parent) , m_captureMode(QCamera::CaptureStillImage) { m_session = qobject_cast(parent); - connect(m_session, &DSCameraSession::statusChanged, + connect(m_session, &DSCameraSession::statusChanged, this, [&](QCamera::Status status) { if (status == QCamera::UnloadedStatus) m_state = QCamera::UnloadedState; -- cgit v1.2.3