Defer widget unallocation until all get_style_context/get_pango_context references are gone
@mgedmin
Submitted by Marius Gedminas Link to original bug (#678607)
Description
The following code causes a segfault in pygobject-introspection 3.3.2 in Ubuntu oneiric nightly CD images:
$ python
>>> import gi
>>> from gi.repository import Gtk
>>> Gtk.MenuBar().get_style_context().get_color(Gtk.StateFlags.NORMAL)
This was originally reported as a bug against gtimelog in Ubuntu, you can see the full output of Gtk+ and Python warnings as well as a stack trace with debug symbols at https://bugs.launchpad.net/gtimelog/+bug/1016212
Some background: I'm the author of GTimeLog. The crashing one-liner is my poor attempt to determine the color (dark/light) of the Gtk+ theme so that I could choose an appropriate image for an GtkStatusIcon when the user is running gnome-panel or Unity desktops.