aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/evas/common/evas_draw_main.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/lib/evas/common/evas_draw_main.c b/src/lib/evas/common/evas_draw_main.c
index 2f3fa949de..518bfb2ac7 100644
--- a/src/lib/evas/common/evas_draw_main.c
+++ b/src/lib/evas/common/evas_draw_main.c
@@ -107,13 +107,9 @@ _evas_common_draw_context_stash(RGBA_Draw_Context *dc)
static RGBA_Draw_Context *
_evas_common_draw_context_find(void)
{
- RGBA_Draw_Context *dc;
+ RGBA_Draw_Context *dc = NULL;
- if (!_ctxt_spares)
- {
- dc = malloc(sizeof(RGBA_Draw_Context));
- }
- else
+ if (_ctxt_spares)
{
SLKL(_ctx_spares_lock);
dc = eina_trash_pop(&_ctxt_spares);
@@ -121,6 +117,8 @@ _evas_common_draw_context_find(void)
SLKU(_ctx_spares_lock);
}
+ if (!dc) dc = malloc(sizeof(RGBA_Draw_Context));
+
return dc;
}