[Mesa-dev] [PATCH] egl: refcount wl_egl_window objects. fix memory corruption

2013-10-08 Thread Giulio Camuffo
Suppose we create a wl_egl_window and an EGLSurface. Then we call eglMakeCurrent(dpy,surf,surf,ctx) with that surface, render and swap. Later we destroy the surface and the window, and we make current another surface. That resulted in two invalid writes because the surface, which is refcounted, get

[Mesa-dev] [PATCH] egl: Flush the Wayland display queue after calling attach/damage/commit

2013-08-22 Thread Giulio Camuffo
eglSwapBuffers() should result in a call to wl_display_flush since it may be called by a rendering thread, and it cannot rely on the main loop to call it. The main loop may indeed be stuck on a wl_display_dispatch() call which blocks until there are events, and if the redraw is triggered by an appl