[gcr] gck: Don't try and discard handle for session that was not opened
- From: Stefan Walter <stefw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gcr] gck: Don't try and discard handle for session that was not opened
- Date: Wed, 2 Nov 2011 08:11:09 +0000 (UTC)
commit f96fe8eb8a497522abd6fd6c0301abff48604e60
Author: Stef Walter <stefw collabora co uk>
Date: Wed Nov 2 08:22:47 2011 +0100
gck: Don't try and discard handle for session that was not opened
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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]