diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2010-09-24 17:59:21 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2010-09-24 17:59:21 +0200 |
commit | 54fdb3c9727ad93502557323820b13c413fa7d4e (patch) | |
tree | 67560a05d158e3b484ae3c88a2545f7cdc5c1a0a | |
parent | 4f0c0fef099155cf3a59b7ee58f697c3cadf98fd (diff) |
misc
-rw-r--r-- | gtk/spice-channel.c | 4 | ||||
-rw-r--r-- | gtk/spice-session.c | 18 |
2 files changed, 18 insertions, 4 deletions
diff --git a/gtk/spice-channel.c b/gtk/spice-channel.c index 94e2fa1..cc7caa6 100644 --- a/gtk/spice-channel.c +++ b/gtk/spice-channel.c @@ -86,6 +86,8 @@ static void spice_channel_dispose(GObject *gobject) spice_channel *c = SPICE_CHANNEL_GET_PRIVATE(channel); fprintf(stderr, "%s %s\n", __FUNCTION__, c->name); + spice_channel_disconnect(channel, SPICE_CHANNEL_CLOSED); + spice_session_channel_destroy(c->session, channel); /* Chain up to the parent class */ if (G_OBJECT_CLASS(spice_channel_parent_class)->dispose) @@ -892,8 +894,6 @@ void spice_channel_destroy(SpiceChannel *channel) spice_channel *c = SPICE_CHANNEL_GET_PRIVATE(channel); fprintf(stderr, "%s %s\n", __FUNCTION__, c->name); - spice_channel_disconnect(channel, SPICE_CHANNEL_CLOSED); - spice_session_channel_destroy(c->session, channel); g_object_unref(channel); } diff --git a/gtk/spice-session.c b/gtk/spice-session.c index 5f67883..d92c195 100644 --- a/gtk/spice-session.c +++ b/gtk/spice-session.c @@ -69,6 +69,18 @@ static void spice_session_init(SpiceSession *session) } static void +spice_session_dispose(GObject *gobject) +{ + SpiceSession *session = SPICE_SESSION(gobject); + + spice_session_disconnect(session); + + /* Chain up to the parent class */ + if (G_OBJECT_CLASS(spice_session_parent_class)->dispose) + G_OBJECT_CLASS(spice_session_parent_class)->dispose(gobject); +} + +static void spice_session_finalize(GObject *gobject) { SpiceSession *session = SPICE_SESSION(gobject); @@ -82,7 +94,8 @@ spice_session_finalize(GObject *gobject) free(s->ca_file); /* Chain up to the parent class */ - G_OBJECT_CLASS(spice_session_parent_class)->finalize(gobject); + if (G_OBJECT_CLASS(spice_session_parent_class)->finalize) + G_OBJECT_CLASS(spice_session_parent_class)->finalize(gobject); } static void spice_session_get_property(GObject *gobject, @@ -160,7 +173,8 @@ static void spice_session_class_init(SpiceSessionClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS(klass); - gobject_class->finalize = spice_session_finalize; + gobject_class->dispose = spice_session_dispose; + gobject_class->finalize = spice_session_finalize; gobject_class->get_property = spice_session_get_property; gobject_class->set_property = spice_session_set_property; |