SessionSpice: Protect against unreffing window twice

In theory, the dispose method can be called multiple times, so any
member variables that are unreffed should be set to NULL so that we
don't accidentally unref them multiple times.
This commit is contained in:
Jonathon Jongsma 2015-04-14 14:38:13 -05:00
parent d316c04345
commit f0c6bb27f4

View File

@ -145,8 +145,7 @@ virt_viewer_session_spice_dispose(GObject *obj)
spice->priv->audio = NULL;
if (spice->priv->main_window)
g_object_unref(spice->priv->main_window);
g_clear_object(&spice->priv->main_window);
G_OBJECT_CLASS(virt_viewer_session_spice_parent_class)->dispose(obj);
}