[glom] Startup: Do not crash when reporting check problems.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom] Startup: Do not crash when reporting check problems.
- Date: Fri, 20 Sep 2013 11:25:03 +0000 (UTC)
commit 5424fc9a3817d60352e1dbde82ec4eb4f844776b
Author: Murray Cumming <murrayc murrayc com>
Date: Fri Sep 20 13:21:57 2013 +0200
Startup: Do not crash when reporting check problems.
* glom/main.c: Instantiate the Application earlier, to ensure
that GTK+ is ready for use.
Also call gtk_init() explicitly because Gtk::Application needs
a fix for this anyway, and it would be nice to use this fix
in Glom versions that do not need a newer gtkmm.
Bug #680411 (Bjørn Lie, Dominique Leuenberger)
glom/main.cc | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/glom/main.cc b/glom/main.cc
index f1e16e6..6646e44 100644
--- a/glom/main.cc
+++ b/glom/main.cc
@@ -489,6 +489,17 @@ main(int argc, char* argv[])
try
{
+ //Create the app here,
+ //so we can use UI, for instance with Gtk::MessageDialog,
+ //even before calling run().
+ Glib::RefPtr<Glom::Application> application =
+ Glom::Application::create();
+
+ //Call gtk_init() too, because earlier (< 3.9.17) versions
+ //of gtkmm do not do this in the default Gtk::Application constructor.
+ //TODO: Remove this when we can depend on a newer gtkmm:
+ gtk_init(0, 0);
+
#ifndef GLOM_ENABLE_CLIENT_ONLY
Gsv::init();
Goocanvas::init();
@@ -537,8 +548,6 @@ main(int argc, char* argv[])
return EXIT_FAILURE;
- Glib::RefPtr<Glom::Application> application =
- Glom::Application::create();
const int status = application->run(argc, argv);
if(status != EXIT_SUCCESS) //TODO: Is this right?
return status;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]