terminology: fix termio's Evas_Smart_Class inheritance usage.

- _smart_add(): if you set the smart data before clipped smart object
   constructor, it will reuse that. No need to get, copy, free then reset.

 - _smart_del(): clipped smart object will free(sd) already, no need
   to do it again (double free).



SVN revision: 81869
This commit is contained in:
Gustavo Sverzut Barbieri 2012-12-29 13:45:38 +00:00
parent dfd5b67b67
commit 6491067714
1 changed files with 3 additions and 9 deletions

View File

@ -2150,19 +2150,15 @@ static void
_smart_add(Evas_Object *obj)
{
Termio *sd;
Evas_Object_Smart_Clipped_Data *cd;
Evas_Object *o;
int i, j, k, l, n;
_parent_sc.add(obj);
cd = evas_object_smart_data_get(obj);
if (!cd) return;
sd = calloc(1, sizeof(Termio));
if (!sd) return;
sd->__clipped_data = *cd;
free(cd);
EINA_SAFETY_ON_NULL_RETURN(sd);
evas_object_smart_data_set(obj, sd);
_parent_sc.add(obj);
/* Terminal output widget */
o = evas_object_textgrid_add(evas_object_evas_get(obj));
evas_object_pass_events_set(o, EINA_TRUE);
@ -2347,8 +2343,6 @@ _smart_del(Evas_Object *obj)
termpty_shutdown();
_parent_sc.del(obj);
evas_object_smart_data_set(obj, NULL);
free(sd);
}
static void