Skip to content

Commit

Permalink
Fix ensure ndk libs are loaded before calling close
Browse files Browse the repository at this point in the history
  • Loading branch information
markushi committed Oct 16, 2024
1 parent 654c2dc commit bcbdcc8
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,15 @@ public static void init(@NotNull final SentryAndroidOptions options) {

/** Closes the NDK integration */
public static void close() {
shutdown();
try {
if (loadLibraryLatch.await(2000, TimeUnit.MILLISECONDS)) {
shutdown();
} else {
throw new IllegalStateException("Timeout waiting for Sentry NDK library to load");
}
} catch (InterruptedException e) {
throw new IllegalStateException(
"Thread interrupted while waiting for NDK libs to be loaded", e);
}
}
}

0 comments on commit bcbdcc8

Please sign in to comment.