fix: Fix Unable to retrieve jni environment. Is the thread attached? errors by using jni::ThreadScope (#2457)
				
					
				
			fix: Add `jni::ThreadScope` to `JVisionCameraScheduler`
This commit is contained in:
		| @@ -21,7 +21,9 @@ void JVisionCameraScheduler::dispatchAsync(const std::function<void()>& job) { | ||||
| } | ||||
|  | ||||
| void JVisionCameraScheduler::scheduleTrigger() { | ||||
|   // 2. schedule `triggerUI` to be called on the java thread | ||||
|   // 2.1 Open a JNI Thread scope because this might be called from a C++ background Thread | ||||
|   jni::ThreadScope scope; | ||||
|   // 2.2 schedule `triggerUI` to be called on the java thread | ||||
|   static auto method = _javaPart->getClass()->getMethod<void()>("scheduleTrigger"); | ||||
|   method(_javaPart.get()); | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user