Skip to content

Refactor Color Palette and ColorItem ownership

Rafał Siejakowski requested to merge S-Rafael/inkscape:swatches-toggle into master

Fix a segfault occurring when the user toggles the Swatches dialog between the "Grid" (no labels) layout and the "Names" (swatches with labels) layout.

The root cause of the crash was that the color items are widgets managed by Gtk. As they were removed from a child list and then reparented, their refcounts were dropping to zero and the reparenting attempt failed.

The solution is to let the palette own the color items; they will not be cleaned up by Gtk and can be reused.

Edited by Rafał Siejakowski

Merge request reports