GNOME Bugzilla – Bug 745829
crash when double-clicking close button while popover is visible
Last modified: 2015-03-16 15:27:24 UTC
I was using GtkInspector to edit some textview properties. If I double click a property in the properties page and change a value, then double click the inspector window's close button, I get a crash. I'm currently running on 3.15.10 (32c0c6fee0ddc7333991db1ae772ebd33fe7a12c) Program received signal SIGSEGV, Segmentation fault. 0x00007ffff3b4a9fa in gtk_widget_pop_verify_invariants (widget=0x159edc0) at gtkwidget.c:10202 10202 g_assert (widget->priv->verifying_invariants_count > 0); (gdb) bt
+ Trace 234818
This is caused by the popover hide animation. Disabling that makes the crash go away.
Created attachment 299507 [details] [review] widget: Take a ref during ::unmap emission This ensures the widget data stays live long enough to perform invariants check after emission if the widget happens to be destroyed on a callback.
Created attachment 299508 [details] [review] window: Protect against popover destruction on ::unmap On popover_unmap(), perform the gtk_widget_unmap() call last, so the GtkWindowPopover data is ensured to be alive throughout the function if the popover widget is destroyed right on ::unmap.
Review of attachment 299507 [details] [review]: makes sense, but I wonder: does gtk_widget_unrealize need a similar fix ?
Review of attachment 299508 [details] [review]: ok
The following fixes have been pushed: b4b2358 window: Protect against popover destruction on ::unmap b4e61b7 widget: Take a ref during ::unrealize emission f5f6ad9 widget: Take a ref during ::unmap emission
Created attachment 299521 [details] [review] window: Protect against popover destruction on ::unmap On popover_unmap(), perform the gtk_widget_unmap() call last, so the GtkWindowPopover data is ensured to be alive throughout the function if the popover widget is destroyed right on ::unmap.
Created attachment 299522 [details] [review] widget: Take a ref during ::unrealize emission In order to prevent invalid memory access/crashes if the widget is destroyed in a callback of that signal.
Created attachment 299523 [details] [review] widget: Take a ref during ::unmap emission This ensures the widget data stays live long enough to perform invariants check after emission if the widget happens to be destroyed on a callback.