From b671a43a315482d931220b8be1e0c6366bc14597 Mon Sep 17 00:00:00 2001 From: Jehan Date: Mon, 26 Feb 2018 18:59:48 +0100 Subject: [PATCH] Bug 793815 - segmentation fault on a handler using finalized user data. The bug is very hard to reproduce, probably because it requires specific timing conditions but this looks like this commit would prevent it. Apparently the signal handler gimp_container_view_name_changed() may have been run while the container view (set as user data) was most likely already finalized, hence leaving an invalid dangling pointer. Let's just make sure we disconnect this handler (and another) when we finalize the container view and its private data. --- app/widgets/gimpcontainerview.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/widgets/gimpcontainerview.c b/app/widgets/gimpcontainerview.c index d4f0585bd9..e95adfcc7c 100644 --- a/app/widgets/gimpcontainerview.c +++ b/app/widgets/gimpcontainerview.c @@ -290,6 +290,10 @@ gimp_container_view_private_finalize (GimpContainerViewPrivate *private) g_hash_table_destroy (private->item_hash); private->item_hash = NULL; } + g_clear_pointer (&private->name_changed_handler, + gimp_tree_handler_disconnect); + g_clear_pointer (&private->expanded_changed_handler, + gimp_tree_handler_disconnect); g_slice_free (GimpContainerViewPrivate, private); }