Skip to content

Commit f92e943

Browse files
committed
runtime: Add function to get runtime without throwing if it is null. This is required to ensure proper cleanup on terminating runtime
1 parent 8a335b3 commit f92e943

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

  • test-app/runtime/src/main/cpp/runtime

test-app/runtime/src/main/cpp/runtime/Runtime.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ namespace tns {
4242
return runtime;
4343
}
4444

45+
inline static Runtime *GetRuntimeUnchecked(napi_env env) {
46+
auto runtime = env_to_runtime_cache.at(env);
47+
return runtime;
48+
}
49+
4550
static void Init(JavaVM *vm);
4651

4752
static void

0 commit comments

Comments
 (0)