diff options
Diffstat (limited to 'base/gxclthrd.c')
-rw-r--r-- | base/gxclthrd.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/base/gxclthrd.c b/base/gxclthrd.c index 6af40a7f..c12af70c 100644 --- a/base/gxclthrd.c +++ b/base/gxclthrd.c @@ -113,12 +113,15 @@ setup_device_and_mem_for_thread(gs_memory_t *chunk_base_mem, gx_device *dev, boo * will spot the same profile being used, and treat it as a no-op. Otherwise it will try to find * a profile with the 'special' name "OI_PROFILE" and throw an error. */ - if (!gscms_is_threadsafe() || (dev->icc_struct != NULL && - ((dev->icc_struct->device_profile[GS_DEFAULT_DEVICE_PROFILE] != NULL && - strncmp(dev->icc_struct->device_profile[GS_DEFAULT_DEVICE_PROFILE]->name, - OI_PROFILE, strlen(OI_PROFILE)) == 0) - || (dev->icc_struct->proof_profile != NULL && - strncmp(dev->icc_struct->proof_profile->name, OI_PROFILE, strlen(OI_PROFILE)) == 0)))) { +#define DEV_PROFILE_IS(DEV, PROFILE, MATCH) \ + ((DEV)->icc_struct != NULL &&\ + (DEV)->icc_struct->PROFILE != NULL &&\ + strcmp((DEV)->icc_struct->PROFILE->name, MATCH) == 0) + + if (bg_print || + !gscms_is_threadsafe() || + DEV_PROFILE_IS(dev, device_profile[GS_DEFAULT_DEVICE_PROFILE], OI_PROFILE) || + DEV_PROFILE_IS(dev, proof_profile, OI_PROFILE)) { ndev->icc_struct = gsicc_new_device_profile_array(ndev); if (!ndev->icc_struct) { emprintf1(ndev->memory, @@ -252,7 +255,7 @@ setup_device_and_mem_for_thread(gs_memory_t *chunk_base_mem, gx_device *dev, boo } rc_increment(*cachep); ncdev->icc_cache_cl = *cachep; - } else if ((ncdev->icc_cache_cl = gsicc_cache_new(thread_mem)) == NULL) + } else if ((ncdev->icc_cache_cl = gsicc_cache_new(thread_mem->thread_safe_memory)) == NULL) goto out_cleanup; } if (bg_print) { |