glom r2053 - in trunk: . glom/libglom



Author: murrayc
Date: Thu Apr  9 18:13:43 2009
New Revision: 2053
URL: http://svn.gnome.org/viewvc/glom?rev=2053&view=rev

Log:
2009-04-09  Murray Cumming  <murrayc murrayc com>

* glom/libglom/connectionpool.cc: get_and_connect(): Check that 
m_backend is not null, to avoid a critical warning.

Modified:
   trunk/ChangeLog
   trunk/glom/libglom/connectionpool.cc

Modified: trunk/glom/libglom/connectionpool.cc
==============================================================================
--- trunk/glom/libglom/connectionpool.cc	(original)
+++ trunk/glom/libglom/connectionpool.cc	Thu Apr  9 18:13:43 2009
@@ -287,14 +287,17 @@
   sharedptr<SharedConnection> result(0);
 
   ConnectionPool* connection_pool = ConnectionPool::get_instance();
-  if(connection_pool)
-  {
+  if(!connection_pool)
+    return result;
+
+  if(!(connection_pool->m_backend.get()))
+    return result; //TODO: Return a FAILURE_NO_BACKEND erro?, though that would be tedious.
+  
 #ifdef GLIBMM_EXCEPTIONS_ENABLED
-    result = connection_pool->connect();
+  result = connection_pool->connect();
 #else
-    result = connection_pool->connect(error);
+  result = connection_pool->connect(error);
 #endif // GLIBMM_EXCEPTIONS_ENABLED
-  }
 
   return result;
 }



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