Evas text: Fix memory leak

Summary:
Fix memory leak

Position is getting returned without
freeing the temporary logical item list.

@fix

Test Plan: NA

Reviewers: tasn, raster

Reviewed By: raster

Subscribers: raster, cedric

Differential Revision: https://phab.enlightenment.org/D3345
This commit is contained in:
Subodh Kumar 2015-11-18 10:52:34 +00:00 committed by Tom Hacohen
parent 1f881c859a
commit 392df9479f
1 changed files with 4 additions and 1 deletions

View File

@ -271,6 +271,7 @@ _evas_object_text_last_up_to_pos(const Evas_Object *eo_obj,
{ {
Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
Evas_Object_Text_Item *it; Evas_Object_Text_Item *it;
int pos = 0;
#ifdef BIDI_SUPPORT #ifdef BIDI_SUPPORT
/*FIXME: not very efficient, sort the items arrays. */ /*FIXME: not very efficient, sort the items arrays. */
@ -291,15 +292,17 @@ _evas_object_text_last_up_to_pos(const Evas_Object *eo_obj,
{ {
if ((x <= cx) && (cx < x + it->adv)) if ((x <= cx) && (cx < x + it->adv))
{ {
return it->text_pos + ENFN->font_last_up_to_pos(ENDT, pos = it->text_pos + ENFN->font_last_up_to_pos(ENDT,
o->font, o->font,
&it->text_props, &it->text_props,
cx - x, cx - x,
cy); cy);
break;
} }
x += it->adv; x += it->adv;
} }
eina_list_free(logical_it); eina_list_free(logical_it);
return pos;
} }
else else
#endif #endif