Modified WIDTYPE check routine. (from SVN rev.50980)
authorDaniel Juyung Seo <juyung.seo@samsung.com>
Wed, 11 Aug 2010 04:25:50 +0000 (13:25 +0900)
committerDaniel Juyung Seo <juyung.seo@samsung.com>
Wed, 11 Aug 2010 04:25:50 +0000 (13:25 +0900)
src/lib/elm_main.c
src/lib/elm_priv.h

index 9faafb7..8cb9dab 100644 (file)
@@ -289,6 +289,26 @@ _elm_rescale(void)
    _elm_win_rescale();
 }
 
+static Eina_List *widtypes = NULL;
+
+void
+_elm_widtype_register(const char **ptr)
+{
+   widtypes = eina_list_append(widtypes, (void *)ptr);
+}
+
+static void
+_elm_widtype_clear(void)
+{
+   const char **ptr;
+   
+   EINA_LIST_FREE(widtypes, ptr)
+     {
+        eina_stringshare_del(*ptr);
+        *ptr = NULL;
+     }
+}
+
 static void                                                                             
 _set_elm_module()                                                                
 {                                                                                
@@ -576,6 +596,8 @@ elm_quicklaunch_shutdown(void)
    _elm_log_dom = -1;
      }
 
+   _elm_widtype_clear();
+   
    eina_shutdown();
 }
 
index aeae950..0674da3 100644 (file)
@@ -206,7 +206,17 @@ Eina_Bool     elm_selection_set(enum _elm_sel_type selection, Evas_Object *widge
 Eina_Bool     elm_selection_clear(enum _elm_sel_type selection, Evas_Object *widget);
 Eina_Bool     elm_selection_get(enum _elm_sel_type selection, enum _elm_sel_format format, Evas_Object *widget);
 
-#define ELM_SET_WIDTYPE(widtype, type) if (!widtype) widtype = eina_stringshare_add(type)
+void              _elm_widtype_register(const char **ptr);
+
+
+#define ELM_SET_WIDTYPE(widtype, type) \
+   do { \
+      if (!widtype) { \
+         widtype = eina_stringshare_add(type); \
+         _elm_widtype_register(&widtype); \
+      } \
+   } while (0)
+
 //#define ELM_CHECK_WIDTYPE(obj, widtype) if (elm_widget_type_get(obj) != widtype) return
 #define ELM_CHECK_WIDTYPE(obj, widtype) if (!_elm_widget_type_check((obj), (widtype))) return