From 0c10b5d65a1212e0040ca8de1b9a3df8622a5e5c Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Mon, 11 Jul 2016 19:50:38 +0100 Subject: JNI: Fix annotation crashing problem. I was forgetting to 'keep' the annot. Inspection of the code shows just 1 other place where I've made that mistake, and it's currently disabled (but updated here anyway). --- platform/java/mupdf_native.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'platform') diff --git a/platform/java/mupdf_native.c b/platform/java/mupdf_native.c index 55839f05..66e63879 100644 --- a/platform/java/mupdf_native.c +++ b/platform/java/mupdf_native.c @@ -658,6 +658,8 @@ static inline jobject to_Annotation(fz_context *ctx, JNIEnv *env, fz_annot *anno if (jannot == NULL) fz_throw_java(ctx, env); + fz_keep_annot(ctx, annot); + return jannot; } @@ -756,6 +758,8 @@ static inline jobject to_Page(fz_context *ctx, JNIEnv *env, fz_page *page) if (jobj == NULL) fz_throw_java(ctx, env); + fz_keep_page(ctx, page); + return jobj; } #endif -- cgit v1.2.3