From 4b239e1fe89d6f9c20c930f1cad4bdfcca88aa32 Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Tue, 18 May 2010 17:08:12 +0100 Subject: [PATCH] clutter-backend-egl: Chain up in dispose before destroying the context clutter_backend_egl_dispose now chains up before disposing its own resources so that ClutterBackendX11 will destroy all of the stages before we destroy the egl context. Otherwise the actors may try to make GL calls during destruction which causes a crash. --- clutter/eglx/clutter-backend-egl.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/clutter/eglx/clutter-backend-egl.c b/clutter/eglx/clutter-backend-egl.c index a056ec28e..05c6e2661 100644 --- a/clutter/eglx/clutter-backend-egl.c +++ b/clutter/eglx/clutter-backend-egl.c @@ -315,6 +315,12 @@ clutter_backend_egl_dispose (GObject *gobject) ClutterBackendEGL *backend_egl = CLUTTER_BACKEND_EGL (gobject); ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (gobject); + /* We chain up before disposing our own resources so that + ClutterBackendX11 will destroy all of the stages before we + destroy the egl context. Otherwise the actors may try to make GL + calls during destruction which causes a crash */ + G_OBJECT_CLASS (clutter_backend_egl_parent_class)->dispose (gobject); + if (backend_egl->dummy_surface != EGL_NO_SURFACE) { eglDestroySurface (backend_egl->edpy, backend_egl->dummy_surface); @@ -338,8 +344,6 @@ clutter_backend_egl_dispose (GObject *gobject) eglTerminate (backend_egl->edpy); backend_egl->edpy = 0; } - - G_OBJECT_CLASS (clutter_backend_egl_parent_class)->dispose (gobject); } static GObject *