diff options
Diffstat (limited to 'base/gscspace.c')
-rw-r--r-- | base/gscspace.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/base/gscspace.c b/base/gscspace.c index d662bc025..9a707a0c0 100644 --- a/base/gscspace.c +++ b/base/gscspace.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2021 Artifex Software, Inc. +/* Copyright (C) 2001-2023 Artifex Software, Inc. All Rights Reserved. This software is provided AS-IS with no warranty, either express or @@ -109,9 +109,11 @@ gs_cspace_final(const gs_memory_t *cmem, void *vptr) if_debug2m('c', cmem, "[c]cspace final "PRI_INTPTR" %d\n", (intptr_t)pcs, (int)pcs->id); rc_decrement_only_cs(pcs->base_space, "gs_cspace_final"); pcs->base_space = NULL; - if (pcs->params.device_n.devn_process_space != NULL) { - rc_decrement_only_cs(pcs->params.device_n.devn_process_space, "gs_cspace_final"); - pcs->params.device_n.devn_process_space = NULL; + if (gs_color_space_get_index(pcs) == gs_color_space_index_DeviceN) { + if (pcs->params.device_n.devn_process_space != NULL) { + rc_decrement_only_cs(pcs->params.device_n.devn_process_space, "gs_cspace_final"); + pcs->params.device_n.devn_process_space = NULL; + } } /* No need to decrement the ICC profile data. It is handled by the finalize of the ICC space which is called above using @@ -135,6 +137,7 @@ gs_cspace_alloc_with_id(gs_memory_t *mem, ulong id, pcs->interpreter_data = NULL; pcs->interpreter_free_cspace_proc = NULL; pcs->cmm_icc_profile_data = NULL; + pcs->ICC_Alternate_space = gs_ICC_Alternate_None; pcs->icc_equivalent = NULL; pcs->params.device_n.devn_process_space = NULL; return pcs; |