From 487f0940377b4fbf9ebae8ab2a53f2f992e60deb Mon Sep 17 00:00:00 2001 From: Nathan Lee <2431820-nathanal@users.noreply.gitlab.com> Date: Thu, 10 Oct 2019 22:05:48 +1100 Subject: Reduce memory leak on editing text, etc. --- src/widgets/toolbox.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/widgets/toolbox.cpp') diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index fc5bad47a..365c0a76f 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -727,7 +727,9 @@ void update_aux_toolbox(SPDesktop * /*desktop*/, ToolBase *eventcontext, GtkWidg gchar const *tname = ( eventcontext ? eventcontext->getPrefsPath().c_str() //g_type_name(G_OBJECT_TYPE(eventcontext)) : nullptr ); - GtkWidget *stack = (GtkWidget *)gtk_container_get_children((GtkContainer *)toolbox)->data; + GList *list = gtk_container_get_children((GtkContainer *)toolbox); + GtkWidget *stack = (GtkWidget *)list->data; + g_list_free(list); gtk_stack_set_visible_child_name((GtkStack *)stack, tname); } -- cgit v1.2.3