From b7e8bb556d7966e5fda7b72869facf51189130e8 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Tue, 26 Mar 2013 11:09:41 +0000 Subject: [PATCH] Evas text: Add apparently important NULL checks. Apparently obj->layer and obj->layer->evas can sometimes be NULL. It is checked in other objects, for example, image object. Add the checks here to "fix" a crash reported by Christopher Michael. --- src/lib/evas/canvas/evas_object_text.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/evas/canvas/evas_object_text.c b/src/lib/evas/canvas/evas_object_text.c index 2d5722a..78c25ee 100644 --- a/src/lib/evas/canvas/evas_object_text.c +++ b/src/lib/evas/canvas/evas_object_text.c @@ -1917,7 +1917,8 @@ evas_object_text_free(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj) if (o->cur.fdesc) evas_font_desc_unref(o->cur.fdesc); if (o->cur.source) eina_stringshare_del(o->cur.source); if (o->cur.text) free(o->cur.text); - if (o->font) evas_font_free(obj->layer->evas->evas, o->font); + if (o->font && obj->layer && obj->layer->evas) + evas_font_free(obj->layer->evas->evas, o->font); #ifdef BIDI_SUPPORT evas_bidi_paragraph_props_unref(o->bidi_par_props); #endif -- 2.7.4