[glom] Fix a crash.



commit 33876e34fd1da6a38d066ee21f13a8d35506782c
Author: Murray Cumming <murrayc murrayc com>
Date:   Mon Sep 28 11:40:36 2009 +0200

    Fix a crash.
    
    * glom/dialog_existing_or_new.cc: Move some assertions so this works
    again in non-client-only mode.

 ChangeLog                      |    7 +++++++
 glom/dialog_existing_or_new.cc |    7 ++-----
 2 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 6f14589..e591942 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2009-09-28  Murray Cumming  <murrayc murrayc com>
 
+	Fix a crash.
+
+	* glom/dialog_existing_or_new.cc: Move some assertions so this works 
+	again in non-client-only mode.
+
+2009-09-28  Murray Cumming  <murrayc murrayc com>
+
 	client-only mode: Ifdef out unused code.
 	
 	* glom/dialog_existing_or_new.[h|cc]: Ifdef out unused code for the new 
diff --git a/glom/dialog_existing_or_new.cc b/glom/dialog_existing_or_new.cc
index 991dbb2..f41021a 100644
--- a/glom/dialog_existing_or_new.cc
+++ b/glom/dialog_existing_or_new.cc
@@ -109,11 +109,7 @@ Dialog_ExistingOrNew::Dialog_ExistingOrNew(BaseObjectType* cobject, const Glib::
 #endif //GLOM_ENABLE_CLIENT_ONLY
   
   builder->get_widget("existing_or_new_existing_treeview", m_existing_view);
-
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
-  if(!m_existing_view || !m_new_view)
-    throw std::runtime_error("Glade file does not contain treeviews for ExistingOrNew dialog.");
-#endif    
+  g_assert(m_existing_view);
 
   builder->get_widget("existing_or_new_notebook", m_notebook);
   builder->get_widget("existing_or_new_button_select", m_select_button);
@@ -221,6 +217,7 @@ Dialog_ExistingOrNew::Dialog_ExistingOrNew(BaseObjectType* cobject, const Glib::
 
 #ifndef GLOM_ENABLE_CLIENT_ONLY
   builder->get_widget("existing_or_new_new_treeview", m_new_view);
+  g_assert(m_new_view);
   m_new_model = Gtk::TreeStore::create(m_new_columns);
   m_new_view->set_model(m_new_model);
   



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]