forked from enlightenment/efl
evas: Fix potential crash with draw context
Using filters I end up in situations where this function returns NULL and all hell breaks loose. I guess the spinlock is what makes this possible (race condition). @fix
This commit is contained in:
parent
fcdf4e9d10
commit
fc82281603
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue