From: tasn Date: Sun, 6 Feb 2011 08:31:46 +0000 (+0000) Subject: Evas font-engine: Don't ref/unref info if len==0 because in this case there's no... X-Git-Tag: submit/trunk/20120815.174732~1961 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3c9ed1084e34abe076f87f21697c827674a99729;p=profile%2Fivi%2Fevas.git Evas font-engine: Don't ref/unref info if len==0 because in this case there's no 'info' but the text prop is legal (empty string). git-svn-id: http://svn.enlightenment.org/svn/e/trunk/evas@56746 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/lib/engines/common/evas_text_utils.c b/src/lib/engines/common/evas_text_utils.c index ebdbfc9..78056ad 100644 --- a/src/lib/engines/common/evas_text_utils.c +++ b/src/lib/engines/common/evas_text_utils.c @@ -39,22 +39,19 @@ evas_common_text_props_content_copy_and_ref(Evas_Text_Props *dst, void evas_common_text_props_content_ref(Evas_Text_Props *props) { + /* No info in this case */ + if (props->len == 0) + return; + props->info->refcount++; } void evas_common_text_props_content_unref(Evas_Text_Props *props) { - /* We allow this, because sometimes we want to have props without info, - * and we don't want to diverge the code paths too much. */ - if (!props->info) - return; - - if (props->info->refcount == 0) - { - ERR("Trying to unref props with refount == 0"); - return; - } + /* No info in this case */ + if (props->len == 0) + return; if (--(props->info->refcount) == 0) { @@ -69,7 +66,7 @@ evas_common_text_props_content_unref(Evas_Text_Props *props) } } -/* Won't work in the middle of ligatures */ +/* Won't work in the middle of ligatures, assumes cutoff < len */ EAPI void evas_common_text_props_split(Evas_Text_Props *base, Evas_Text_Props *ext, int cutoff)