]> err.no Git - libchamplain/commitdiff
Reset the factory instance pointer to NULL if it gets destroyed
authorPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Tue, 12 May 2009 15:41:08 +0000 (11:41 -0400)
committerPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Tue, 12 May 2009 15:41:08 +0000 (11:41 -0400)
champlain/champlain-map-source-factory.c

index 5b5271b67ee64e0ac8ec44ff69b7f7270ccfc06a..2bd84a34a36a8e184fb4a841accc1e21f3f4f437 100644 (file)
@@ -29,7 +29,7 @@
  *
  * To get the list of registered map sources, use
  * #champlain_map_source_factory_get_list.
- * 
+ *
  */
 #include "config.h"
 
@@ -228,6 +228,7 @@ champlain_map_source_factory_get_default (void)
   if (G_UNLIKELY (instance == NULL))
     {
       instance = g_object_new (CHAMPLAIN_TYPE_MAP_SOURCE_FACTORY, NULL);
+      g_object_add_weak_pointer (G_OBJECT (instance), (gpointer*)&instance);
       return instance;
     }