forked from enlightenment/terminology
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:
parent
dfd5b67b67
commit
6491067714
|
@ -2150,19 +2150,15 @@ static void
|
||||||
_smart_add(Evas_Object *obj)
|
_smart_add(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
Termio *sd;
|
Termio *sd;
|
||||||
Evas_Object_Smart_Clipped_Data *cd;
|
|
||||||
Evas_Object *o;
|
Evas_Object *o;
|
||||||
int i, j, k, l, n;
|
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));
|
sd = calloc(1, sizeof(Termio));
|
||||||
if (!sd) return;
|
EINA_SAFETY_ON_NULL_RETURN(sd);
|
||||||
sd->__clipped_data = *cd;
|
|
||||||
free(cd);
|
|
||||||
evas_object_smart_data_set(obj, sd);
|
evas_object_smart_data_set(obj, sd);
|
||||||
|
|
||||||
|
_parent_sc.add(obj);
|
||||||
|
|
||||||
/* Terminal output widget */
|
/* Terminal output widget */
|
||||||
o = evas_object_textgrid_add(evas_object_evas_get(obj));
|
o = evas_object_textgrid_add(evas_object_evas_get(obj));
|
||||||
evas_object_pass_events_set(o, EINA_TRUE);
|
evas_object_pass_events_set(o, EINA_TRUE);
|
||||||
|
@ -2347,8 +2343,6 @@ _smart_del(Evas_Object *obj)
|
||||||
termpty_shutdown();
|
termpty_shutdown();
|
||||||
|
|
||||||
_parent_sc.del(obj);
|
_parent_sc.del(obj);
|
||||||
evas_object_smart_data_set(obj, NULL);
|
|
||||||
free(sd);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in New Issue