Skip to content

Commit

Permalink
fix: memory leak when the load default palette button is repeatedly p…
Browse files Browse the repository at this point in the history
…ressed (synfig#2633)

-freed the memory of the tables children from the previous iteration when the refresh function is called.
  • Loading branch information
Kemosalamy authored Nov 21, 2023
1 parent 1cef34f commit 5e40169
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions synfig-studio/src/gui/modules/mod_palette/dock_paledit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,11 @@ Dock_PalEdit::refresh()
{
const int width(12);

// Free table children from memory
std::vector<Widget*> children = table.get_children();
for(Widget* child : children)
delete child;

// Clear the table
table.foreach(sigc::mem_fun(table,&Gtk::Table::remove));

Expand Down

0 comments on commit 5e40169

Please sign in to comment.