Allow initializing wxWidgets multiple times against one instance of GTK+
See #17751
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/toplevel.h"
|
||||
#include "wx/module.h"
|
||||
#endif
|
||||
|
||||
#include "wx/fontutil.h"
|
||||
@@ -1008,3 +1009,23 @@ bool wxSystemSettingsNative::HasFeature(wxSystemFeature index)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __WXGTK3__
|
||||
class wxSystemSettingsModule: public wxModule
|
||||
{
|
||||
public:
|
||||
virtual bool OnInit() wxOVERRIDE { return true; }
|
||||
virtual void OnExit() wxOVERRIDE;
|
||||
wxDECLARE_DYNAMIC_CLASS(wxSystemSettingsModule);
|
||||
};
|
||||
wxIMPLEMENT_DYNAMIC_CLASS(wxSystemSettingsModule, wxModule);
|
||||
|
||||
void wxSystemSettingsModule::OnExit()
|
||||
{
|
||||
GtkSettings* settings = gtk_settings_get_default();
|
||||
g_signal_handlers_disconnect_by_func(settings,
|
||||
(void*)notify_gtk_theme_name, NULL);
|
||||
g_signal_handlers_disconnect_by_func(settings,
|
||||
(void*)notify_gtk_font_name, NULL);
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user