surface: Give backends a chance to disconnect

Call the destroy vfunc before clearing
frame clock and gl context, so backends
have a chance to clean up.
This commit is contained in:
Matthias Clasen
2019-05-24 01:56:35 +00:00
parent 37f8df2722
commit a3f127b0d0

View File

@@ -919,6 +919,8 @@ _gdk_surface_destroy_hierarchy (GdkSurface *surface,
display = gdk_surface_get_display (surface);
GDK_SURFACE_GET_CLASS (surface)->destroy (surface, foreign_destroy);
if (surface->gl_paint_context)
{
/* Make sure to destroy if current */
@@ -936,8 +938,6 @@ _gdk_surface_destroy_hierarchy (GdkSurface *surface,
_gdk_surface_clear_update_area (surface);
GDK_SURFACE_GET_CLASS (surface)->destroy (surface, foreign_destroy);
surface->state |= GDK_SURFACE_STATE_WITHDRAWN;
surface->destroyed = TRUE;