GTK: delete all gtkmm objects before destrying Gtk::Main.

Otherwise this results in harmless but annoying spam on applciation
shutdown.

See https://gitlab.gnome.org/GNOME/gtkmm/issues/22.
pull/441/head
whitequark 2019-05-31 23:01:10 +00:00
parent 359697990a
commit 3d80062b66
6 changed files with 11 additions and 1 deletions

View File

@ -29,8 +29,8 @@ int main(int argc, char** argv) {
Platform::Close3DConnexion(); Platform::Close3DConnexion();
SS.Clear(); SS.Clear();
SK.Clear(); SK.Clear();
Platform::ClearGui();
return 0; return 0;
} }

View File

@ -380,6 +380,7 @@ void OpenInBrowser(const std::string &url);
void InitGui(int argc, char **argv); void InitGui(int argc, char **argv);
void RunGui(); void RunGui();
void ExitGui(); void ExitGui();
void ClearGui();
} }

View File

@ -1475,6 +1475,9 @@ void RunGui() {
void ExitGui() { void ExitGui() {
gtkMain->quit(); gtkMain->quit();
}
void ClearGui() {
delete gtkMain; delete gtkMain;
} }

View File

@ -1479,5 +1479,7 @@ void ExitGui() {
[NSApp terminate:nil]; [NSApp terminate:nil];
} }
void ClearGui() {}
} }
} }

View File

@ -154,6 +154,8 @@ void ExitGui() {
exit(0); exit(0);
} }
void ClearGui() {}
} }
} }

View File

@ -1677,5 +1677,7 @@ void ExitGui() {
PostQuitMessage(0); PostQuitMessage(0);
} }
void ClearGui() {}
} }
} }