+// Modules are cleaned up after wxApp::CleanUp(), and some modules may
+// require MGL to still be alive, e.g. the stock fonts need the fonts
+// manager. So append this module last minute in wxApp::CleanUp() to close
+// down MGL after all the other modules have been cleaned up.
+//
+struct wxMGLFinalCleanup: public wxModule
+{
+ bool OnInit() { return true; }
+
+ void OnExit()
+ {
+ wxFontsManager::CleanUp();
+
+ wxDestroyMGL_WM();
+ MGL_exit();
+ }
+};
+