prefs init should probably clean up after itself when it fucks up
authorzmike <michael.blumenkrantz@gmail.com>
Mon, 20 Jan 2014 18:25:59 +0000 (13:25 -0500)
committerzmike <michael.blumenkrantz@gmail.com>
Mon, 20 Jan 2014 18:36:56 +0000 (13:36 -0500)
legacy/elementary/src/lib/elm_prefs.c

index 7203f8d..443b49e 100644 (file)
@@ -2136,17 +2136,21 @@ _elm_prefs_init(void)
    _elm_prefs_descriptors_init();
    _elm_prefs_data_init();
 
-   _elm_prefs_page_widgets_map = eina_hash_string_superfast_new(NULL);
-   _elm_prefs_item_widgets_map = eina_hash_string_superfast_new(NULL);
-   _elm_prefs_item_type_widgets_map = eina_hash_int32_new(NULL);
-
    if (!(m = _elm_module_find_as("prefs_iface")))
      {
-        DBG("prefs iface module could not be loaded,"
+        WRN("prefs iface module could not be loaded,"
             " the prefs widget won't function");
 
+        --_elm_prefs_init_count;
+        _elm_prefs_descriptors_shutdown();
+        _elm_prefs_data_shutdown();
         return;
      }
+
+   _elm_prefs_page_widgets_map = eina_hash_string_superfast_new(NULL);
+   _elm_prefs_item_widgets_map = eina_hash_string_superfast_new(NULL);
+   _elm_prefs_item_type_widgets_map = eina_hash_int32_new(NULL);
+
    m->init_func(m);
 }