diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/libcamera/camera.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp index 4a9c19c3..ae16a64a 100644 --- a/src/libcamera/camera.cpp +++ b/src/libcamera/camera.cpp @@ -16,6 +16,7 @@ #include "libcamera/internal/log.h" #include "libcamera/internal/pipeline_handler.h" +#include "libcamera/internal/thread.h" #include "libcamera/internal/utils.h" /** @@ -470,7 +471,10 @@ std::shared_ptr<Camera> Camera::create(PipelineHandler *pipe, struct Deleter : std::default_delete<Camera> { void operator()(Camera *camera) { - camera->deleteLater(); + if (Thread::current() == camera->thread()) + delete camera; + else + camera->deleteLater(); } }; |