ColorPalette: Fix Dispose function

* Set freed pointer to NULL in dispose function because dispose cna be run multiple times. This fixes the case of freeing an already freed pointer.
This commit is contained in:
Mario Hüttel 2020-07-09 23:54:40 +02:00
parent f135b42d8a
commit f6abfada2c
1 changed files with 1 additions and 0 deletions

View File

@ -238,6 +238,7 @@ static void color_palette_dispose(GObject *gobj)
if (palette->color_array) {
palette->color_array_length = 0;
free(palette->color_array);
palette->color_array = NULL;
}
/* Chain up to parent class */