diff options
author | Sebastian Rasmussen <sebras@gmail.com> | 2016-08-16 03:07:09 +0800 |
---|---|---|
committer | Sebastian Rasmussen <sebras@gmail.com> | 2016-08-16 03:18:11 +0800 |
commit | 3a8037e3f003052e6a2b9de01d8743552a9d6bae (patch) | |
tree | 16113b28cb2fb4f6ff9998190ec0c48c0778eb55 | |
parent | 14ba33d1abf9010878a4fd3626d516da6c8919f0 (diff) | |
download | mupdf-3a8037e3f003052e6a2b9de01d8743552a9d6bae.tar.xz |
JNI: Add finalizers for Shade and PDFGraftMap.
-rw-r--r-- | platform/java/mupdf_native.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/platform/java/mupdf_native.c b/platform/java/mupdf_native.c index 6ce4c132..fc90b6e8 100644 --- a/platform/java/mupdf_native.c +++ b/platform/java/mupdf_native.c @@ -7247,3 +7247,31 @@ FUN(PDFObject_toString)(JNIEnv *env, jobject self, jboolean tight) return string; } + +/* Shade interface */ + +JNIEXPORT void JNICALL +FUN(Shade_finalize)(JNIEnv *env, jobject self) +{ + fz_context *ctx = get_context(env); + fz_shade *shd = from_Shade(env, self); + + if (ctx == NULL || shd == NULL) + return; + + fz_drop_shade(ctx, shd); +} + +/* PDFGraftMap interface */ + +JNIEXPORT void JNICALL +FUN(PDFGraftMap_finalize)(JNIEnv *env, jobject self) +{ + fz_context *ctx = get_context(env); + pdf_graft_map *map = from_PDFGraftMap(env, self); + + if (ctx == NULL || map == NULL) + return; + + pdf_drop_graft_map(ctx, map); +} |