Hello.
Emitting "destroy" signal on last remaining top level window is bad idea, use gtk_widget_destroy function instead, which is a wrapper around that signal and does some things that ensure everything is in a consistent state throughout the destroy process.
And if you're curious enough to ask "Why is last top level window so special?", well, prepare for a rough ride on a roller coaster of GObject destruction process. Documentation about this can be found here:
http://library.gnome.org/devel/gobject/stable/chapter-gobject.html (the part that causes troubles for you is described with one paragraph inside those docs:
GObject docs wrote:
GObject's memory management model was designed to be easily integrated in existing code using garbage collection. This is why the destruction process is split in two phases: the first phase, executed in the dispose handler is supposed to release all references to other member objects. The second phase, executed by the finalize handler is supposed to complete the object's destruction process. Object methods should be able to run without program error (that is, without segfault :) in-between the two phases.
The main problem of your way is that when the top level window's GtkStyle is unreferenced and destroyed (since this is the last widget that was holding a reference to it), there is no default style anywhere to find (since we just destroyed it with previous call) which is usually attached to widget to go through the destruction process smoothly.