Skip to content

Commit 819139e

Browse files
author
Mihail Slavchev
committed
keep HandleScope it order to prevent SIGSEGV
1 parent 1b1f25b commit 819139e

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

src/jni/com_tns_NativeScriptActity.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,17 @@ jobject ConvertJsValueToJavaObject(JEnv& env, const Local<Value>& value);
2828
//no need to extract the methods to a separate class because this file will be gone in the near future.
2929
extern "C" jobjectArray Java_com_tns_NativeScriptActivity_getMethodOverrides(JNIEnv *_env, jobject obj, jint objectId, jobjectArray packagedArgs)
3030
{
31+
auto isolate = g_isolate;
32+
Isolate::Scope isolate_scope(isolate);
33+
HandleScope handleScope(isolate);
34+
3135
jobjectArray joa = nullptr;
3236
try
3337
{
3438
DEBUG_WRITE("getMethodOverrides called");
3539

36-
auto isolate = g_isolate;
37-
Isolate::Scope isolate_scope(isolate);
38-
3940
JEnv env(_env);
4041

41-
HandleScope handleScope(isolate);
42-
4342
auto appInstance = g_objectManager->GetJsObjectByJavaObject(AppJavaObjectID);
4443
if (appInstance.IsEmpty())
4544
{

0 commit comments

Comments
 (0)