[glom/glom-1-24] Startup: Do not crash when reporting check problems.



commit e010b61ad29d9a2c944b08deb4f2a6c1ce1bd0d8
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 e358fdd..234c978 100644
--- a/glom/main.cc
+++ b/glom/main.cc
@@ -485,6 +485,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();
@@ -533,8 +544,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]