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).

SVN revision: 56746
This commit is contained in:
Tom Hacohen 2011-02-06 08:31:46 +00:00
parent dd094399bb
commit 2f9d2760ee
1 changed files with 8 additions and 11 deletions

View File

@ -39,23 +39,20 @@ evas_common_text_props_content_copy_and_ref(Evas_Text_Props *dst,
void void
evas_common_text_props_content_ref(Evas_Text_Props *props) evas_common_text_props_content_ref(Evas_Text_Props *props)
{ {
/* No info in this case */
if (props->len == 0)
return;
props->info->refcount++; props->info->refcount++;
} }
void void
evas_common_text_props_content_unref(Evas_Text_Props *props) evas_common_text_props_content_unref(Evas_Text_Props *props)
{ {
/* We allow this, because sometimes we want to have props without info, /* No info in this case */
* and we don't want to diverge the code paths too much. */ if (props->len == 0)
if (!props->info)
return; return;
if (props->info->refcount == 0)
{
ERR("Trying to unref props with refount == 0");
return;
}
if (--(props->info->refcount) == 0) if (--(props->info->refcount) == 0)
{ {
if (props->info->glyph) if (props->info->glyph)
@ -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 EAPI void
evas_common_text_props_split(Evas_Text_Props *base, evas_common_text_props_split(Evas_Text_Props *base,
Evas_Text_Props *ext, int cutoff) Evas_Text_Props *ext, int cutoff)