Fix critical error when Gnucash closes with report pages open

Prior to Gtk version 3.20, when using gtk_container_remove the removed
widget was required to be the direct child of the container.
This commit is contained in:
Robert Fewell 2017-07-23 11:36:05 +01:00 committed by John Ralls
parent e41410ef25
commit bbd29b69c6

View File

@ -245,8 +245,15 @@ gnc_html_webkit_dispose( GObject* obj )
if ( priv->web_view != NULL )
{
// In Gtk Version 3.20 they relaxed the fact that the widget should be a
// direct child of the container otherwise it would be a critical error
#if GTK_CHECK_VERSION(3,20,0)
gtk_container_remove( GTK_CONTAINER(priv->base.container),
GTK_WIDGET(priv->web_view) );
#else
GtkWidget *parent = gtk_widget_get_parent(GTK_WIDGET(priv->web_view));
gtk_container_remove( GTK_CONTAINER(priv->base.container), parent);
#endif
priv->web_view = NULL;
}