* Fix the evas memory leak - eina_rectangles allocated internally.
+2012-11-21 Carsten Haitzler (The Rasterman)
+
+ * Fixed leak in textblock and text props in general that made
+ textblock recalcs lead very badly. Required changed to textgrid
+ though a sit relied on the leaky behavior.
+
* Fix evas textblock tag parser to respect escaped spaces and escaped single quotes
* Fixed longstanding memset bug in evas box.
* Fixed GLX native surface handling (fixes new mesa+intel comp bug).
-
+ * Fixed textblock textprop leak.
+
Changes since Evas 1.7.0:
-------------------------
if (o->last_glyphs)
{
- if (o->last_mask && (o->last_mask & codepoint) == o->last_mask)
+ if ((o->last_mask) && ((o->last_mask & codepoint) == o->last_mask))
goto end;
}
goto end;
}
- while (shift > 8
- && o->master[offset].next[(codepoint & mask) >> shift] != 0)
+ while ((shift > 8)
+ && (o->master[offset].next[(codepoint & mask) >> shift] != 0))
{
offset = o->master[offset].next[(codepoint & mask) >> shift];
mask >>= 4;
eina_array_push(&o->glyphs_cleanup,
(void *)((unsigned long)props_index));
else
- evas_common_text_props_content_unref(props);
+ {
+ Evas_Glyph *glyphs = props->glyphs;
+ int glyphs_length = props->glyphs_length;
+
+ evas_common_text_props_content_nofree_unref(props);
+ }
}
}
props_index = (unsigned int) (intptr_t) eina_array_pop(&o->glyphs_cleanup);
prop = &(o->glyphs[props_index >> 8].props[props_index & 0xFF]);
-
- evas_common_text_props_content_unref(prop);
+
+ evas_common_text_props_content_nofree_unref(prop);
if (!prop->info)
{
o->glyphs_used[props_index >> 8]--;
props_index = (unsigned int) (intptr_t) eina_array_pop(&o->glyphs_cleanup);
prop = &(o->glyphs[props_index >> 8].props[props_index & 0xFF]);
- evas_common_text_props_content_unref(prop);
+ evas_common_text_props_content_nofree_unref(prop);
if (!prop->info)
{
o->glyphs_used[props_index >> 8]--;
props_index = (unsigned int) (intptr_t) eina_array_pop(&o->glyphs_cleanup);
prop = &(o->glyphs[props_index >> 8].props[props_index & 0xFF]);
- evas_common_text_props_content_unref(prop);
+ evas_common_text_props_content_nofree_unref(prop);
if (!prop->info)
{
o->glyphs_used[props_index >> 8]--;
}
void
-evas_common_text_props_content_unref(Evas_Text_Props *props)
+evas_common_text_props_content_nofree_unref(Evas_Text_Props *props)
{
/* No content in this case */
if (!props->info)
evas_common_font_int_unref(props->font_instance);
props->font_instance = NULL;
}
-
+
if (--(props->info->refcount) == 0)
{
free(props->glyphs);
props->glyphs = NULL;
props->glyphs_length = 0;
+
+ if (props->info->glyph)
+ free(props->info->glyph);
+#ifdef OT_SUPPORT
+ if (props->info->ot)
+ free(props->info->ot);
+#endif
+ free(props->info);
+ props->info = NULL;
+ }
+}
+void
+evas_common_text_props_content_unref(Evas_Text_Props *props)
+{
+ /* No content in this case */
+ if (!props->info)
+ return;
+
+ if (props->font_instance)
+ {
+ evas_common_font_int_unref(props->font_instance);
+ props->font_instance = NULL;
+ }
+
+ free(props->glyphs);
+ props->glyphs = NULL;
+ props->glyphs_length = 0;
+
+ if (--(props->info->refcount) == 0)
+ {
if (props->info->glyph)
free(props->info->glyph);
#ifdef OT_SUPPORT
evas_common_text_props_content_ref(Evas_Text_Props *props);
void
+evas_common_text_props_content_nofree_unref(Evas_Text_Props *props);
+
+void
evas_common_text_props_content_unref(Evas_Text_Props *props);
EAPI int