summaryrefslogtreecommitdiff
path: root/src/lib/evas/common
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2012-11-21 09:12:42 +0000
committerCarsten Haitzler <raster@rasterman.com>2012-11-21 09:12:42 +0000
commita89d61079c1c2ed1d5113c987f95c9d7263dc48a (patch)
treed5c407c4d56cdaefc24008fc4ddf72a8752fffbf /src/lib/evas/common
parent2b0829785f0f10213a461fba98dcddea00f4c0d5 (diff)
fix evil textprop leak in textblock! :)
SVN revision: 79503
Diffstat (limited to 'src/lib/evas/common')
-rw-r--r--src/lib/evas/common/evas_text_utils.c34
-rw-r--r--src/lib/evas/common/evas_text_utils.h3
2 files changed, 35 insertions, 2 deletions
diff --git a/src/lib/evas/common/evas_text_utils.c b/src/lib/evas/common/evas_text_utils.c
index acdcc0042f..7abf07fa6f 100644
--- a/src/lib/evas/common/evas_text_utils.c
+++ b/src/lib/evas/common/evas_text_utils.c
@@ -54,7 +54,7 @@ evas_common_text_props_content_ref(Evas_Text_Props *props)
54} 54}
55 55
56void 56void
57evas_common_text_props_content_unref(Evas_Text_Props *props) 57evas_common_text_props_content_nofree_unref(Evas_Text_Props *props)
58{ 58{
59 /* No content in this case */ 59 /* No content in this case */
60 if (!props->info) 60 if (!props->info)
@@ -65,13 +65,43 @@ evas_common_text_props_content_unref(Evas_Text_Props *props)
65 evas_common_font_int_unref(props->font_instance); 65 evas_common_font_int_unref(props->font_instance);
66 props->font_instance = NULL; 66 props->font_instance = NULL;
67 } 67 }
68 68
69 if (--(props->info->refcount) == 0) 69 if (--(props->info->refcount) == 0)
70 { 70 {
71 free(props->glyphs); 71 free(props->glyphs);
72 props->glyphs = NULL; 72 props->glyphs = NULL;
73 props->glyphs_length = 0; 73 props->glyphs_length = 0;
74
75 if (props->info->glyph)
76 free(props->info->glyph);
77#ifdef OT_SUPPORT
78 if (props->info->ot)
79 free(props->info->ot);
80#endif
81 free(props->info);
82 props->info = NULL;
83 }
84}
74 85
86void
87evas_common_text_props_content_unref(Evas_Text_Props *props)
88{
89 /* No content in this case */
90 if (!props->info)
91 return;
92
93 if (props->font_instance)
94 {
95 evas_common_font_int_unref(props->font_instance);
96 props->font_instance = NULL;
97 }
98
99 free(props->glyphs);
100 props->glyphs = NULL;
101 props->glyphs_length = 0;
102
103 if (--(props->info->refcount) == 0)
104 {
75 if (props->info->glyph) 105 if (props->info->glyph)
76 free(props->info->glyph); 106 free(props->info->glyph);
77#ifdef OT_SUPPORT 107#ifdef OT_SUPPORT
diff --git a/src/lib/evas/common/evas_text_utils.h b/src/lib/evas/common/evas_text_utils.h
index 675df6c200..2b1caf1d87 100644
--- a/src/lib/evas/common/evas_text_utils.h
+++ b/src/lib/evas/common/evas_text_utils.h
@@ -81,6 +81,9 @@ void
81evas_common_text_props_content_ref(Evas_Text_Props *props); 81evas_common_text_props_content_ref(Evas_Text_Props *props);
82 82
83void 83void
84evas_common_text_props_content_nofree_unref(Evas_Text_Props *props);
85
86void
84evas_common_text_props_content_unref(Evas_Text_Props *props); 87evas_common_text_props_content_unref(Evas_Text_Props *props);
85 88
86EAPI int 89EAPI int