From 0f3ca349e7a013955cc0d4965207b13763c0b342 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Sat, 13 Jul 2019 09:37:47 +0200 Subject: [PATCH] node editor: Manually unrealize all created renderers This has not been a problem before since we were leaking them. --- demos/node-editor/node-editor-window.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/demos/node-editor/node-editor-window.c b/demos/node-editor/node-editor-window.c index 08559f167c..9e880354f3 100644 --- a/demos/node-editor/node-editor-window.c +++ b/demos/node-editor/node-editor-window.c @@ -707,6 +707,14 @@ static void node_editor_window_unrealize (GtkWidget *widget) { NodeEditorWindow *self = NODE_EDITOR_WINDOW (widget); + guint i; + + for (i = 0; i < g_list_model_get_n_items (G_LIST_MODEL (self->renderers)); i ++) + { + gpointer item = g_list_model_get_item (G_LIST_MODEL (self->renderers), i); + gsk_renderer_unrealize (gtk_renderer_paintable_get_renderer (item)); + g_object_unref (item); + } g_list_store_remove_all (self->renderers);