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.
This commit is contained in:
Jehan 2018-02-26 18:59:48 +01:00
parent 479b7e31d0
commit b671a43a31
1 changed files with 4 additions and 0 deletions

View File

@ -290,6 +290,10 @@ gimp_container_view_private_finalize (GimpContainerViewPrivate *private)
g_hash_table_destroy (private->item_hash); g_hash_table_destroy (private->item_hash);
private->item_hash = NULL; 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); g_slice_free (GimpContainerViewPrivate, private);
} }