summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2016-04-26 20:11:49 +0200
committerTor Andersson <tor.andersson@artifex.com>2016-04-27 17:01:06 +0200
commit9b4acc78d2a56a5f79d69f50e72197930509505e (patch)
treeb30e03bd1e80d859b578324425e2486f122c5ac8 /include
parented763d50c7363af5f09d24d0e04b95ca59ff7960 (diff)
downloadmupdf-9b4acc78d2a56a5f79d69f50e72197930509505e.tar.xz
Add fz_close_device function.
Garbage collected languages need a way to signal that they are done with a device other than freeing it. Call it implicitly on fz_drop_device; so take care not to call it again in case it has been explicitly called already.
Diffstat (limited to 'include')
-rw-r--r--include/mupdf/fitz/device.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/mupdf/fitz/device.h b/include/mupdf/fitz/device.h
index 34faa06e..f9295349 100644
--- a/include/mupdf/fitz/device.h
+++ b/include/mupdf/fitz/device.h
@@ -101,7 +101,7 @@ struct fz_device_s
int hints;
int flags;
- void (*drop_imp)(fz_context *, fz_device *);
+ void (*close)(fz_context *, fz_device *);
void (*fill_path)(fz_context *, fz_device *, const fz_path *, int even_odd, const fz_matrix *, fz_colorspace *, const float *color, float alpha);
void (*stroke_path)(fz_context *, fz_device *, const fz_path *, const fz_stroke_state *, const fz_matrix *, fz_colorspace *, const float *color, float alpha);
@@ -167,6 +167,13 @@ void fz_render_flags(fz_context *ctx, fz_device *dev, int set, int clear);
void *fz_new_device(fz_context *ctx, int size);
/*
+ fz_close_device: Flush any pending output and free internal memory.
+ This is called implicitly on fz_drop_device, so it's only useful for
+ garbage collected language bindings.
+*/
+void fz_close_device(fz_context *ctx, fz_device *dev);
+
+/*
fz_drop_device: Free a devices of any type and its resources.
*/
void fz_drop_device(fz_context *ctx, fz_device *dev);