diff --git a/src/multimedia/camera/qcamera.cpp b/src/multimedia/camera/qcamera.cpp index dba761a0ab6d8660d7300463be1be5655b587271..46c6af9ff689d2986fb7e8a464897557463acd42 100644 --- a/src/multimedia/camera/qcamera.cpp +++ b/src/multimedia/camera/qcamera.cpp @@ -362,9 +362,17 @@ QCamera::QCamera(const QByteArray& deviceName, QObject *parent): // The camera should not be used if device with requested name does not exist. if (!found) { - if (d->service && d->control) - d->service->releaseControl(d->control); + if (d->service) { + if (d->control) + d->service->releaseControl(d->control); + if (d->deviceControl) + d->service->releaseControl(d->deviceControl); + if (d->infoControl) + d->service->releaseControl(d->infoControl); + } d->control = nullptr; + d->deviceControl = nullptr; + d->infoControl = nullptr; d->error = QCamera::ServiceMissingError; d->errorString = QCamera::tr("The camera service is missing"); }