diff options
author | Stef Walter <stefw@collabora.co.uk> | 2011-11-02 08:22:47 +0100 |
---|---|---|
committer | Stef Walter <stefw@collabora.co.uk> | 2011-11-02 08:22:47 +0100 |
commit | f96fe8eb8a497522abd6fd6c0301abff48604e60 (patch) | |
tree | fd4f1e05aa39457b297d80b1347ed7d86fafe5e9 /gck/gck-session.c | |
parent | cb5ac66f0773c439c00b8a87f4a43e2532402412 (diff) | |
download | gcr-f96fe8eb8a497522abd6fd6c0301abff48604e60.tar.gz |
gck: Don't try and discard handle for session that was not opened
Diffstat (limited to 'gck/gck-session.c')
-rw-r--r-- | gck/gck-session.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gck/gck-session.c b/gck/gck-session.c index 8b4ca76..a6ce5f1 100644 --- a/gck/gck-session.c +++ b/gck/gck-session.c @@ -228,7 +228,8 @@ gck_session_dispose (GObject *obj) g_return_if_fail (GCK_IS_SESSION (self)); - if (g_atomic_int_compare_and_exchange (&self->pv->discarded, 0, 1)) { + if (self->pv->handle != 0 && + g_atomic_int_compare_and_exchange (&self->pv->discarded, 0, 1)) { /* * Let the world know that we're discarding the session @@ -247,7 +248,8 @@ gck_session_finalize (GObject *obj) { GckSession *self = GCK_SESSION (obj); - g_assert (g_atomic_int_get (&self->pv->discarded) != 0); + g_assert (self->pv->handle == 0 || + g_atomic_int_get (&self->pv->discarded) != 0); g_clear_object (&self->pv->interaction); g_clear_object (&self->pv->slot); |