diff --git a/src/main.cpp b/src/main.cpp index 811ccaf10..7a493504e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -28,6 +28,7 @@ #include "src/persistence/profilelocker.h" #include "src/widget/loginscreen.h" #include "src/widget/translator.h" +#include "src/video/camerasource.h" #include #include #include @@ -275,6 +276,7 @@ int main(int argc, char *argv[]) logFile = nullptr; #endif + CameraSource::destroyInstance(); Nexus::destroyInstance(); Settings::destroyInstance(); qDebug() << "Clean exit with status"<releaseFrame(); } + freelist.clear(); + freelist.squeeze(); // Free our resources and close the device videoStreamIndex = -1; diff --git a/src/video/camerasource.h b/src/video/camerasource.h index 61f5f5bd8..234a67a7e 100644 --- a/src/video/camerasource.h +++ b/src/video/camerasource.h @@ -47,6 +47,7 @@ class CameraSource : public VideoSource Q_OBJECT public: static CameraSource& getInstance(); + static void destroyInstance(); /// Opens the source for the camera device in argument, in the settings, or the system default /// If a device is already open, the source will seamlessly switch to the new device void open();