elm_theme: Check the ref count to delete or unref. 86/204686/2
authorWoochanlee <wc0917.lee@samsung.com>
Thu, 25 Apr 2019 12:19:35 +0000 (21:19 +0900)
committerJaehyun Cho <jae_hyun.cho@samsung.com>
Thu, 25 Apr 2019 12:24:37 +0000 (12:24 +0000)
In case of the ref count bigger than 1.
That means the eo_theme ref count is 2.

In that case we need to call efl_unref when theme freed.
other case we can delete eo_theme.

@fix

https://phab.enlightenment.org/D8714
e25f00c2d5d98854b1ddab5d9d3b34ce63766db3

Change-Id: Ifcbcd40ece56f8b466fbb3e00b1344a000f55ca8

src/lib/elementary/elm_theme.c

index 5b66540..4c35f18 100644 (file)
@@ -533,7 +533,10 @@ elm_theme_free(Elm_Theme *th)
    /* Destructs theme object and theme is deallocated in
     * _elm_theme_free_internal() in theme object desctructor.
     */
-   efl_unref(th->eo_theme);
+   if (efl_ref_count(th->eo_theme) > 1)
+     efl_unref(th->eo_theme);
+   else
+     efl_del(th->eo_theme);
 }
 
 static void