summaryrefslogtreecommitdiff
path: root/legacy/evas/src/lib/engines/common/evas_text_utils.c
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2012-06-28 10:13:05 +0000
committerCarsten Haitzler <raster@rasterman.com>2012-06-28 10:13:05 +0000
commit6d605629cafb9e7c6bb4c923624e16062d2dee48 (patch)
treec80c45d52a2f00df20c45afc8c2752b231e198fc /legacy/evas/src/lib/engines/common/evas_text_utils.c
parentc6f644fbe088bb67a6557c729eb99995192b8240 (diff)
fix refcounting issue with font instances.
SVN revision: 72990
Diffstat (limited to '')
-rw-r--r--legacy/evas/src/lib/engines/common/evas_text_utils.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/legacy/evas/src/lib/engines/common/evas_text_utils.c b/legacy/evas/src/lib/engines/common/evas_text_utils.c
index dca75f6cd3..c1c1a2335e 100644
--- a/legacy/evas/src/lib/engines/common/evas_text_utils.c
+++ b/legacy/evas/src/lib/engines/common/evas_text_utils.c
@@ -47,6 +47,8 @@ evas_common_text_props_content_ref(Evas_Text_Props *props)
47 return; 47 return;
48 48
49 props->info->refcount++; 49 props->info->refcount++;
50 if (props->font_instance)
51 ((RGBA_Font_Int *)props->font_instance)->references++;
50} 52}
51 53
52void 54void
@@ -56,6 +58,12 @@ evas_common_text_props_content_unref(Evas_Text_Props *props)
56 if (!props->info) 58 if (!props->info)
57 return; 59 return;
58 60
61 if (props->font_instance)
62 {
63 evas_common_font_int_unref(props->font_instance);
64 props->font_instance = NULL;
65 }
66
59 if (--(props->info->refcount) == 0) 67 if (--(props->info->refcount) == 0)
60 { 68 {
61 if (props->bin) 69 if (props->bin)
@@ -478,8 +486,14 @@ evas_common_text_props_content_create(void *_fi, const Eina_Unicode *text,
478 } 486 }
479 text_props->info = calloc(1, sizeof(Evas_Text_Props_Info)); 487 text_props->info = calloc(1, sizeof(Evas_Text_Props_Info));
480 488
481 text_props->font_instance = fi; 489 if (text_props->font_instance != fi)
482 490 {
491 if (text_props->font_instance)
492 evas_common_font_int_unref(text_props->font_instance);
493 text_props->font_instance = fi;
494 fi->references++;
495 }
496
483 evas_common_font_int_reload(fi); 497 evas_common_font_int_reload(fi);
484 if (fi->src->current_size != fi->size) 498 if (fi->src->current_size != fi->size)
485 { 499 {