Fix GTK error wxApp::CleanUp() when GUI is not initialised
For the programs that use wxWidgets but can also run using just CLI, exiting the program would show a bogus GTK error GLib-GObject-CRITICAL **: g_type_class_unref: assertion 'g_class != NULL' failed Fix this by only releasing the references to GTK_TYPE_WIDGET if we had acquired it in the first place. See https://github.com/wxWidgets/wxWidgets/pull/129 (this is a backport of e1f31febadea7d6277c7ee92c424ae7581e1d6d1 from master)
This commit is contained in:
@@ -491,7 +491,9 @@ void wxApp::CleanUp()
|
||||
g_source_remove(m_idleSourceId);
|
||||
|
||||
// release reference acquired by Initialize()
|
||||
g_type_class_unref(g_type_class_peek(GTK_TYPE_WIDGET));
|
||||
gpointer gt = g_type_class_peek(GTK_TYPE_WIDGET);
|
||||
if (gt != NULL)
|
||||
g_type_class_unref(gt);
|
||||
|
||||
gdk_threads_leave();
|
||||
|
||||
|
Reference in New Issue
Block a user