summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2016-04-25 15:44:33 +0200
committerTor Andersson <tor.andersson@artifex.com>2016-04-26 15:12:57 +0200
commitbd1609f3b55c9ec9a6d6e519381d755629de114e (patch)
tree0b4a276fd6a1847a1e4347305029e74565ae8f9b
parentf730023f7cc5417dfe8fb5b957a0990832c81d31 (diff)
downloadmupdf-bd1609f3b55c9ec9a6d6e519381d755629de114e.tar.xz
murun: Automatically convert object argument to obj.writeObject().
-rw-r--r--source/tools/murun.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source/tools/murun.c b/source/tools/murun.c
index 4992514a..a42a4bbf 100644
--- a/source/tools/murun.c
+++ b/source/tools/murun.c
@@ -2747,9 +2747,12 @@ static void ffi_PDFObject_writeObject(js_State *J)
{
fz_context *ctx = js_getcontext(J);
pdf_obj *ref = js_touserdata(J, 0, "pdf_obj");
- pdf_obj *obj = js_touserdata(J, 1, "pdf_obj");
+ pdf_document *pdf = pdf_get_bound_document(ctx, ref);
+ pdf_obj *obj = ffi_toobj(J, pdf, 1);
fz_try(ctx)
- pdf_update_object(ctx, pdf_get_bound_document(ctx, ref), pdf_to_num(ctx, ref), obj);
+ pdf_update_object(ctx, pdf, pdf_to_num(ctx, ref), obj);
+ fz_always(ctx)
+ pdf_drop_obj(ctx, obj);
fz_catch(ctx)
rethrow(J);
}