[Spice-devel,spice-gtk,v2,07/19] migration: remove migration cleanup from dispose

Submitted by marcandre.lureau@redhat.com on Nov. 13, 2014, 11:32 p.m.

Details

Message ID 1415921562-6267-8-git-send-email-marcandre.lureau@redhat.com
State Accepted
Commit 5ef64315f816e14041eca65bd15266e2ea2e9394
Headers show

Not browsing as part of any series.

Commit Message

marcandre.lureau@redhat.com Nov. 13, 2014, 11:32 p.m.
The spice_session_disconnect() method now calls
spice_session_abort_migration(), so it is not necessary to do migration
cleanups in dispose anymore
---
 gtk/spice-session.c | 24 +++++++++---------------
 1 file changed, 9 insertions(+), 15 deletions(-)

Patch hide | download patch | download mbox

diff --git a/gtk/spice-session.c b/gtk/spice-session.c
index d8cb790..4bb2b9f 100644
--- a/gtk/spice-session.c
+++ b/gtk/spice-session.c
@@ -180,21 +180,9 @@  spice_session_dispose(GObject *gobject)
 
     spice_session_disconnect(session);
 
-    if (s->migration) {
-        spice_session_disconnect(s->migration);
-        g_object_unref(s->migration);
-        s->migration = NULL;
-    }
-
-    if (s->migration_left) {
-        g_list_free(s->migration_left);
-        s->migration_left = NULL;
-    }
-
-    if (s->after_main_init) {
-        g_source_remove(s->after_main_init);
-        s->after_main_init = 0;
-    }
+    g_warn_if_fail(s->migration == NULL);
+    g_warn_if_fail(s->migration_left == NULL);
+    g_warn_if_fail(s->after_main_init == 0);
 
     g_clear_object(&s->audio_manager);
     g_clear_object(&s->desktop_integration);
@@ -1500,6 +1488,12 @@  end:
     g_object_unref(s->migration);
     s->migration = NULL;
 
+    s->migrate_wait_init = FALSE;
+    if (s->after_main_init) {
+        g_source_remove(s->after_main_init);
+        s->after_main_init = 0;
+    }
+
     spice_session_set_migration_state(session, SPICE_SESSION_MIGRATION_NONE);
 }