forked from enlightenment/efl
ecore_evas_extn: Add safety checks, fixing a crash in elm_test
See T2835 (my crash was different from the one reported). The buffer may be initialized after the first render_pre, due to whatever timing issue. Check in elm_test "Window Socket" and then open several "Window Plug". @fix
This commit is contained in:
parent
cca830832a
commit
4d4e6fd4b1
|
@ -118,6 +118,7 @@ _extnbuf_data_get(Extnbuf *b, int *w, int *h, int *stride)
|
|||
void *
|
||||
_extnbuf_lock(Extnbuf *b, int *w, int *h, int *stride)
|
||||
{
|
||||
if (!b) return NULL;
|
||||
if (!b->have_lock)
|
||||
{
|
||||
if (b->lockfd >= 0)
|
||||
|
@ -136,7 +137,7 @@ _extnbuf_lock(Extnbuf *b, int *w, int *h, int *stride)
|
|||
void
|
||||
_extnbuf_unlock(Extnbuf *b)
|
||||
{
|
||||
if (!b->have_lock) return;
|
||||
if (!b || !b->have_lock) return;
|
||||
if (b->lockfd >= 0)
|
||||
{
|
||||
if (lockf(b->lockfd, F_ULOCK, 0) < 0)
|
||||
|
|
Loading…
Reference in New Issue