Skip to content

Commit

Permalink
Double the safety before freeing histogram caches
Browse files Browse the repository at this point in the history
  • Loading branch information
aurelienpierre committed Jul 16, 2024
1 parent 9ec8f69 commit 2d4f274
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/develop/develop.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ void dt_dev_cleanup(dt_develop_t *dev)
// image_cache does not have to be unref'd, this is done outside develop module.
dt_pthread_mutex_destroy(&dev->pipe_mutex);

dt_free_align(dev->raw_histogram.buffer);
dt_free_align(dev->output_histogram.buffer);
dt_free_align(dev->display_histogram.buffer);
if(dev->raw_histogram.buffer) dt_free_align(dev->raw_histogram.buffer);
if(dev->output_histogram.buffer) dt_free_align(dev->output_histogram.buffer);
if(dev->display_histogram.buffer) dt_free_align(dev->display_histogram.buffer);

dev->proxy.chroma_adaptation = NULL;
dev->proxy.wb_coeffs[0] = 0.f;
Expand Down

0 comments on commit 2d4f274

Please sign in to comment.