create global ref properly in YogaJNIException
Summary: ##Changelog: [Internal][Yoga] create global ref properly in YogaJNIException Reviewed By: astreet Differential Revision: D18775982 fbshipit-source-id: ee529d6178d40b5f887fa1327fe156fa466f154f
This commit is contained in:
committed by
Facebook Github Bot
parent
ac8eb111a9
commit
089095f532
@@ -96,6 +96,16 @@ ScopedGlobalRef<jobject> newGlobalRef(JNIEnv* env, jobject obj) {
|
||||
|
||||
return make_global_ref(result);
|
||||
}
|
||||
|
||||
ScopedGlobalRef<jthrowable> newGlobalRef(JNIEnv* env, jthrowable obj) {
|
||||
jthrowable result = static_cast<jthrowable>(env->NewGlobalRef(obj));
|
||||
|
||||
if (!result) {
|
||||
logErrorMessageAndDie("Could not obtain global reference from object");
|
||||
}
|
||||
|
||||
return make_global_ref(result);
|
||||
}
|
||||
} // namespace vanillajni
|
||||
} // namespace yoga
|
||||
} // namespace facebook
|
||||
|
Reference in New Issue
Block a user