diff --git a/gdk/gdkglcontext.c b/gdk/gdkglcontext.c index 62b60f5ebc..3c5e4ffdb1 100644 --- a/gdk/gdkglcontext.c +++ b/gdk/gdkglcontext.c @@ -185,8 +185,7 @@ gdk_gl_context_dispose (GObject *gobject) if (priv->egl_context != NULL) { - GdkSurface *surface = gdk_gl_context_get_surface (context); - GdkDisplay *display = gdk_surface_get_display (surface); + GdkDisplay *display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context)); EGLDisplay *egl_display = gdk_display_get_egl_display (display); if (eglGetCurrentContext () == priv->egl_context) diff --git a/testsuite/gdk/memorytexture.c b/testsuite/gdk/memorytexture.c index bbc563bab9..372cece19d 100644 --- a/testsuite/gdk/memorytexture.c +++ b/testsuite/gdk/memorytexture.c @@ -649,6 +649,7 @@ main (int argc, char *argv[]) gsk_renderer_unrealize (gl_renderer); g_clear_object (&gl_renderer); } + gdk_gl_context_clear_current (); return result; } diff --git a/testsuite/gdk/texture-threads.c b/testsuite/gdk/texture-threads.c index 753513faaf..529e2351e6 100644 --- a/testsuite/gdk/texture-threads.c +++ b/testsuite/gdk/texture-threads.c @@ -108,6 +108,7 @@ texture_threads (void) g_clear_pointer (&loop, g_main_loop_unref); g_clear_object (&gl_renderer); g_main_context_release (NULL); + gdk_gl_context_clear_current (); } int