1
0
Fork 0

clutter-backend-glx: Protect against unrefing the Cogl context twice

The dispose function may be called multiple times during destruction
so it needs to be resilient against destroying any resources
twice. This wasn't the case for the reference to the Cogl context.
This commit is contained in:
Neil Roberts 2011-04-20 11:10:54 +01:00
parent b061f73702
commit 49233af465

View file

@ -147,7 +147,11 @@ clutter_backend_glx_dispose (GObject *gobject)
* make Cogl calls during destruction which would cause a crash */
G_OBJECT_CLASS (clutter_backend_glx_parent_class)->dispose (gobject);
cogl_object_unref (backend->cogl_context);
if (backend->cogl_context)
{
cogl_object_unref (backend->cogl_context);
backend->cogl_context = NULL;
}
}
static GObject *