BAD_EGL_ALLOC fix

tanks for fix to walter79