Reset pre-initialized object to null pointer
authorHwankyu Jhun <h.jhun@samsung.com>
Wed, 30 Nov 2016 10:43:46 +0000 (19:43 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Thu, 1 Dec 2016 23:27:07 +0000 (08:27 +0900)
Change-Id: I27d3ff1c875189d17fae7cc167daf0ef005abd84
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/app_resource.c

index 374472b5cff8af39ab9d19f2fb07afa6e18aa3c0..ff36edccc001f87bed7d229704e473729db22de5 100644 (file)
 
 void *app_get_preinitialized_window(const char *win_name)
 {
-       if (elm_win_precreated_object_get() == NULL)
+       void *win;
+
+       win = elm_win_precreated_object_get();
+       if (win == NULL)
                return NULL;
 
        appcore_set_preinit_window_name(win_name);
-       return elm_win_precreated_object_get();
+       elm_win_precreated_object_set(NULL);
+
+       return win;
 }
 
 void *app_get_preinitialized_background(void)
 {
-       return elm_bg_precreated_object_get();
+       void *background;
+
+       background = elm_bg_precreated_object_get();
+       if (background == NULL)
+               return NULL;
+
+       elm_bg_precreated_object_set(NULL);
+
+       return background;
 }
 
 void *app_get_preinitialized_conformant(void)
 {
-       return elm_conformant_precreated_object_get();
+       void *conformant;
+
+       conformant = elm_conformant_precreated_object_get();
+       if (conformant == NULL)
+               return NULL;
+
+       elm_conformant_precreated_object_set(NULL);
+
+       return conformant;
 }