Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 757def52 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Correct scanInitializeNative mutex lock location" into main am: 7493a3e8

parents bb0e371c 7493a3e8
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2468,10 +2468,11 @@ static void periodicScanCleanupNative(JNIEnv* env, jobject /* object */) {
}

static void scanInitializeNative(JNIEnv* env, jobject object) {
  std::unique_lock<std::shared_mutex> lock(callbacks_mutex);

  sScanner = bluetooth::shim::get_ble_scanner_instance();
  sScanner->RegisterCallbacks(JniScanningCallbacks::GetInstance());

  std::unique_lock<std::shared_mutex> lock(callbacks_mutex);
  if (mScanCallbacksObj != NULL) {
    log::warn("Cleaning up scan callback object");
    env->DeleteGlobalRef(mScanCallbacksObj);