Skip to content
Snippets Groups Projects
Commit 39811a2c authored by Adam Welc's avatar Adam Welc
Browse files

Merge pull request #583 in G/fastr from ~ADAM.WELC_ORACLE.COM/fastr:bugfix/rstudio-fixes2 to master

* commit '31073919':
  Fixes to the native interface.
parents d513ed12 31073919
No related branches found
No related tags found
No related merge requests found
......@@ -645,17 +645,17 @@ SEXP R_getContextSrcRef(CTXT context) {
int R_insideBrowser() {
JNIEnv *jniEnv = getEnv();
jmethodID methodID = checkGetMethodID(jniEnv, UpCallsRFFIClass, "R_insideBrowser", "()I", 0);
return (*jniEnv)->CallStaticIntMethod(jniEnv, UpCallsRFFIClass, methodID);
return (*jniEnv)->CallIntMethod(jniEnv, UpCallsRFFIObject, methodID);
}
int R_isGlobal(CTXT context) {
JNIEnv *jniEnv = getEnv();
jmethodID methodID = checkGetMethodID(jniEnv, UpCallsRFFIClass, "R_isGlobal", "(Ljava/lang/Object;)I", 0);
return (*jniEnv)->CallStaticIntMethod(jniEnv, UpCallsRFFIClass, methodID, context);
return (*jniEnv)->CallIntMethod(jniEnv, UpCallsRFFIObject, methodID, context);
}
int R_isEqual(void* x, void* y) {
JNIEnv *jniEnv = getEnv();
jmethodID methodID = checkGetMethodID(jniEnv, UpCallsRFFIClass, "R_isEqual", "(Ljava/lang/Object;Ljava/lang/Object;)I", 0);
return (*jniEnv)->CallStaticIntMethod(jniEnv, UpCallsRFFIClass, methodID, x, y);
return (*jniEnv)->CallIntMethod(jniEnv, UpCallsRFFIObject, methodID, x, y);
}
......@@ -88,7 +88,7 @@ static jmp_buf* callErrorJmpBufTable[CALLDEPTH_STACK_SIZE];
void init_utils(JNIEnv *env, jobject upCallsInstance) {
curenv = env;
UpCallsRFFIClass = (*env)->GetObjectClass(env, upCallsInstance);
UpCallsRFFIClass = (*env)->NewGlobalRef(env, (*env)->GetObjectClass(env, upCallsInstance));
UpCallsRFFIObject = (*env)->NewGlobalRef(env, upCallsInstance);
if (TRACE_ENABLED && traceFile == NULL) {
if (!isEmbedded) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment