diff --git a/src/common/darktable.c b/src/common/darktable.c index 82dfa12277bf..a3bedf307d31 100644 --- a/src/common/darktable.c +++ b/src/common/darktable.c @@ -2060,12 +2060,6 @@ void dt_cleanup() // we can no longer call dt_gui_process_events after this point, as that will cause a segfault // if some delayed event fires - dt_image_cache_cleanup(darktable.image_cache); - free(darktable.image_cache); - darktable.image_cache = NULL; - dt_mipmap_cache_cleanup(darktable.mipmap_cache); - free(darktable.mipmap_cache); - darktable.mipmap_cache = NULL; if(init_gui) { dt_imageio_cleanup(darktable.imageio); @@ -2081,6 +2075,13 @@ void dt_cleanup() darktable.gui = NULL; } + dt_image_cache_cleanup(darktable.image_cache); + free(darktable.image_cache); + darktable.image_cache = NULL; + dt_mipmap_cache_cleanup(darktable.mipmap_cache); + free(darktable.mipmap_cache); + darktable.mipmap_cache = NULL; + dt_colorspaces_cleanup(darktable.color_profiles); dt_conf_cleanup(darktable.conf); free(darktable.conf);