From 55992bb954acde1aba8d85f92e59271809355607 Mon Sep 17 00:00:00 2001 From: bglgwyng Date: Tue, 20 Feb 2024 00:01:21 +0900 Subject: [PATCH] fix: Fix Frame Processor SIGSEV crash in `VisionCameraScheduler::trigger` by locking mutex in `dispatchAsync` (#2591) Add missing lock. --- .../cpp/frameprocessor/java-bindings/JVisionCameraScheduler.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/package/android/src/main/cpp/frameprocessor/java-bindings/JVisionCameraScheduler.cpp b/package/android/src/main/cpp/frameprocessor/java-bindings/JVisionCameraScheduler.cpp index 77a28a6..816b0af 100644 --- a/package/android/src/main/cpp/frameprocessor/java-bindings/JVisionCameraScheduler.cpp +++ b/package/android/src/main/cpp/frameprocessor/java-bindings/JVisionCameraScheduler.cpp @@ -15,6 +15,7 @@ TSelf JVisionCameraScheduler::initHybrid(jni::alias_ref jThis) { } void JVisionCameraScheduler::dispatchAsync(const std::function& job) { + std::unique_lock lock(_mutex); // 1. add job to queue _jobs.push(job); scheduleTrigger();