Skip to content

Commit

Permalink
fix(android): release string (#11153)
Browse files Browse the repository at this point in the history
  • Loading branch information
garymathews authored Sep 12, 2019
1 parent b3a720a commit 0e21a4f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions android/runtime/v8/src/native/V8Runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,17 +381,20 @@ JNIEXPORT void JNICALL Java_org_appcelerator_kroll_runtime_v8_V8Runtime_nativeAd

if (!cls) {
LOGE(TAG, "Could not find source code provider class for module: %s", mName);
env->ReleaseStringUTFChars(moduleName, mName);
return;
}

jmethodID method = env->GetMethodID(cls, "getSourceCode", "(Ljava/lang/String;)Ljava/lang/String;");
env->DeleteLocalRef(cls);
if (!method) {
LOGE(TAG, "Could not find getSourceCode method in source code provider class for module: %s", mName);
env->ReleaseStringUTFChars(moduleName, mName);
return;
}

KrollBindings::addExternalCommonJsModule(mName, env->NewGlobalRef(sourceProvider), method);
env->ReleaseStringUTFChars(moduleName, mName);
}

// This method disposes of all native resources used by V8 when
Expand Down

0 comments on commit 0e21a4f

Please sign in to comment.