If a frame callback is not destroyed when destroying a surface, its
handler function will be invoked if the surface was destroyed after the
callback was requested but before it was invoked, causing a write on
free:ed memory.
This can happen if eglDestroySurface() is called shortly after
eglSwapBuffers().
Note: This is a candidate for stable branches.
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
dri2_surf->third_buffer);
}
+ if (dri2_surf->frame_callback)
+ wl_callback_destroy(dri2_surf->frame_callback);
+
free(surf);
return EGL_TRUE;
wl_buffer_destroy(surface->buffer[buffer]);
}
+ if (surface->frame_callback)
+ wl_callback_destroy(surface->frame_callback);
+
resource_surface_destroy(surface->rsurf);
FREE(surface);
}