summaryrefslogtreecommitdiff
path: root/base/gslibctx.c
diff options
context:
space:
mode:
authorRobin Watts <Robin.Watts@artifex.com>2020-06-25 19:15:28 +0100
committerRobin Watts <Robin.Watts@artifex.com>2020-06-25 19:17:08 +0100
commit305b9fa7334fc0cd1f45585b8449b0c2c7517559 (patch)
tree988f229287b4d8a238b66693b47b366b76e5e807 /base/gslibctx.c
parent59bd5d853cec55497486ad4fb2f253a92e4da3cc (diff)
downloadghostpdl-305b9fa7334fc0cd1f45585b8449b0c2c7517559.tar.gz
Fix leak of non-deregistered callback handlers on shutdown.
Diffstat (limited to 'base/gslibctx.c')
-rw-r--r--base/gslibctx.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/base/gslibctx.c b/base/gslibctx.c
index 35490b504..ec4fdfd91 100644
--- a/base/gslibctx.c
+++ b/base/gslibctx.c
@@ -388,6 +388,7 @@ void gs_lib_ctx_fin(gs_memory_t *mem)
gs_memory_t *ctx_mem;
int refs, i;
gs_fs_list_t *fs;
+ gs_callout_list_t *entry;
if (!mem || !mem->gs_lib_ctx)
return;
@@ -430,6 +431,13 @@ void gs_lib_ctx_fin(gs_memory_t *mem)
fs = next;
}
+ entry = ctx->core->callouts;
+ while (entry) {
+ gs_callout_list_t *next = entry->next;
+ gs_free_object(mem->non_gc_memory, entry, "gs_callout_list_t");
+ entry = next;
+ }
+
for (i = 0; i < ctx->core->argc; i++)
gs_free_object(ctx->core->memory, ctx->core->argv[i], "gs_lib_ctx_arg");
gs_free_object(ctx->core->memory, ctx->core->argv, "gs_lib_ctx_args");