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:
parent
b061f73702
commit
49233af465
@ -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 *
|
||||
|
Loading…
Reference in New Issue
Block a user