GLView: Clean up the native surface during deletion
authorJean-Philippe Andre <jp.andre@samsung.com>
Mon, 1 Sep 2014 07:36:36 +0000 (16:36 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Mon, 20 Oct 2014 03:16:42 +0000 (12:16 +0900)
src/lib/elm_glview.c

index 0e10f25..20216c8 100644 (file)
@@ -239,6 +239,8 @@ _elm_glview_evas_object_smart_add(Eo *obj, Elm_Glview_Data *priv)
 EOLIAN static void
 _elm_glview_evas_object_smart_del(Eo *obj, Elm_Glview_Data *sd)
 {
+   ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
+
    // Call delete func if it's registered
    if (sd->del_func)
      {
@@ -248,7 +250,11 @@ _elm_glview_evas_object_smart_del(Eo *obj, Elm_Glview_Data *sd)
 
    ecore_idle_enterer_del(sd->render_idle_enterer);
 
-   if (sd->surface) evas_gl_surface_destroy(sd->evasgl, sd->surface);
+   if (sd->surface)
+     {
+        evas_object_image_native_surface_set(wd->resize_obj, NULL);
+        evas_gl_surface_destroy(sd->evasgl, sd->surface);
+     }
    if (sd->context) evas_gl_context_destroy(sd->evasgl, sd->context);
    if (sd->config) evas_gl_config_free(sd->config);
    if (sd->evasgl) evas_gl_free(sd->evasgl);