On Monday, December 17, 2012, Enlightenment SVN wrote: > Log: > efl: detect all text change properly and don't destroy text if we don't > relayout it. > > > Author: cedric > Date: 2012-12-16 19:34:08 -0800 (Sun, 16 Dec 2012) > New Revision: 81061 > Trac: http://trac.enlightenment.org/e/changeset/81061 > > Modified: > trunk/efl/src/lib/evas/canvas/evas_object_text.c > > Modified: trunk/efl/src/lib/evas/canvas/evas_object_text.c > =================================================================== > --- trunk/efl/src/lib/evas/canvas/evas_object_text.c 2012-12-17 > 03:14:22 UTC (rev 81060) > +++ trunk/efl/src/lib/evas/canvas/evas_object_text.c 2012-12-17 > 03:34:08 UTC (rev 81061) > @@ -34,6 +34,7 @@ > > unsigned char style; > double ellipsis; > + Eina_Unicode *text; > } cur, prev; > > float ascent, descent; > @@ -667,7 +668,7 @@ > * @param text the text to layout > */ > static void > -_evas_object_text_layout(Evas_Object *eo_obj, Evas_Object_Text *o, const > Eina_Unicode *text) > +_evas_object_text_layout(Evas_Object *eo_obj, Evas_Object_Text *o, > Eina_Unicode *text) > { > Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS); > EvasBiDiStrIndex *v_to_l = NULL; > @@ -680,11 +681,14 @@ > #endif > > if (!memcmp(&o->cur, &o->prev, sizeof (o->cur)) && > + o->cur.text == text && > obj->cur.scale == obj->prev.scale && > o->last_computed.w == obj->cur.geometry.w && > o->last_computed.h == obj->cur.geometry.h) > return ; > > Leaks text here
> + if (o->items) _evas_object_text_items_clean(obj, o); > + > #ifdef BIDI_SUPPORT > if (o->bidi_delimiters) > segment_idxs = evas_bidi_segment_idxs_get(text, o->bidi_delimiters); > @@ -865,6 +869,8 @@ > } > } > } > + if (o->prev.text != text) free(o->prev.text); > + o->cur.text = text; > o->prev = o->cur; > > _evas_object_text_item_order(eo_obj, o); > @@ -974,11 +980,6 @@ > { > eina_stringshare_replace(&o->cur.utf8_text, NULL); > } > - if (text) > - { > - free(text); > - text = NULL; > - } > _evas_object_text_recalc(eo_obj); > o->changed = 1; > evas_object_change(eo_obj, obj); > @@ -994,7 +995,6 @@ > obj->layer->evas->last_timestamp, > NULL); > evas_object_inform_call_resize(eo_obj); > - if (text) free(text); > } > > EAPI void > @@ -2340,17 +2340,11 @@ > Evas_Object_Text *o = eo_data_get(eo_obj, MY_CLASS); > Eina_Unicode *text = NULL; > > - if (o->items) _evas_object_text_items_clean(obj, o); > - if (o->cur.utf8_text) > - text = eina_unicode_utf8_to_unicode(o->cur.utf8_text, > - NULL); > - > + text = o->cur.text; > if (!text) text = eina_unicode_strdup(EINA_UNICODE_EMPTY_STRING); > > _evas_object_text_layout(eo_obj, o, text); > > - if (text) free(text); > - > if ((o->font) && (o->items)) > { > int w, h; > > > > ------------------------------------------------------------------------------ > LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial > Remotely access PCs and mobile devices and provide instant support > Improve your efficiency, and focus on delivering more value-add services > Discover what IT Professionals Know. Rescue delivers > http://p.sf.net/sfu/logmein_12329d2d > _______________________________________________ > enlightenment-svn mailing list > enlightenment-...@lists.sourceforge.net <javascript:;> > https://lists.sourceforge.net/lists/listinfo/enlightenment-svn > -- Gustavo Sverzut Barbieri http://profusion.mobi embedded systems -------------------------------------- MSN: barbi...@gmail.com Skype: gsbarbieri Mobile: +55 (19) 9225-2202 ------------------------------------------------------------------------------ LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel