forked from enlightenment/efl
efl ui text - fix resource leak of strbuf and pointless buffer code
edje_object_part_text_style_user_push() doesnt need you to stringshare_add a string... some other code did it because it "gets" the string from an obj that might free/delete the string on push etc. or before so it keeps a copy but then it stringshare_del's it anyway... the _textpath_ellipsis_set() code creates a trsbuf that wasn't freed if enabled was false and it never stringshare_del'd the string is stringshare_added... all of this was pointless code anyway. you could just pass the constant string directly. fixes CID 1380543
This commit is contained in:
parent
e095562ea1
commit
bee7bf5767
|
@ -410,17 +410,11 @@ _sizing_eval(Efl_Ui_Textpath_Data *pd)
|
||||||
static void
|
static void
|
||||||
_textpath_ellipsis_set(Efl_Ui_Textpath_Data *pd, Eina_Bool enabled)
|
_textpath_ellipsis_set(Efl_Ui_Textpath_Data *pd, Eina_Bool enabled)
|
||||||
{
|
{
|
||||||
Eina_Strbuf *buf = eina_strbuf_new();
|
|
||||||
const char *format;
|
|
||||||
|
|
||||||
edje_object_part_text_style_user_pop(pd->text_obj, "elm.text");
|
edje_object_part_text_style_user_pop(pd->text_obj, "elm.text");
|
||||||
|
|
||||||
if (enabled)
|
if (enabled)
|
||||||
{
|
edje_object_part_text_style_user_push(pd->text_obj, "elm.text",
|
||||||
eina_strbuf_append_printf(buf, "DEFAULT='ellipsis=1.0'");
|
"DEFAULT='ellipsis=1.0'");
|
||||||
format = eina_stringshare_add(eina_strbuf_string_get(buf));
|
|
||||||
eina_strbuf_free(buf);
|
|
||||||
edje_object_part_text_style_user_push(pd->text_obj, "elm.text", format);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in New Issue