diff options
author | Sebastian Rasmussen <sebras@gmail.com> | 2016-09-05 13:07:57 +0800 |
---|---|---|
committer | Sebastian Rasmussen <sebras@gmail.com> | 2016-09-08 18:53:00 +0800 |
commit | a7f20b00995ec482b2bf93c4fc80aa2ac26a045d (patch) | |
tree | 5de28818c2f7e22de8eb541635e188bb6f7c0c0c /platform | |
parent | 0f27e8fe136c245f5af5d6071f041dbcd1129333 (diff) | |
download | mupdf-a7f20b00995ec482b2bf93c4fc80aa2ac26a045d.tar.xz |
JNI: Make sure to keep fitz objects passed to Java objects.
Diffstat (limited to 'platform')
-rw-r--r-- | platform/java/mupdf_native.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/platform/java/mupdf_native.c b/platform/java/mupdf_native.c index 8c59a41d..faa08abd 100644 --- a/platform/java/mupdf_native.c +++ b/platform/java/mupdf_native.c @@ -6345,7 +6345,6 @@ FUN(PDFObject_resolve)(JNIEnv *env, jobject self) fz_context *ctx = get_context(env); pdf_obj *obj = from_PDFObject(env, self); pdf_obj *ind = NULL; - jobject jobj = NULL; if (!ctx) return NULL; if (!obj) { jni_throw_arg(env, "object must not be null"); return NULL; } @@ -6358,11 +6357,8 @@ FUN(PDFObject_resolve)(JNIEnv *env, jobject self) return NULL; } - jobj = (*env)->NewObject(env, cls_PDFObject, mid_PDFObject_init, jlong_cast(ind), self); - if (jobj) - pdf_keep_obj(ctx, ind); - - return jobj; + pdf_keep_obj(ctx, ind); + return (*env)->NewObject(env, cls_PDFObject, mid_PDFObject_init, jlong_cast(ind), self); } JNIEXPORT jobject JNICALL |