diff options
author | Jonathon Jongsma <jjongsma@redhat.com> | 2015-04-14 14:38:13 -0500 |
---|---|---|
committer | Jonathon Jongsma <jjongsma@redhat.com> | 2015-04-15 09:18:16 -0500 |
commit | f0c6bb27f48d8482684809b4ea9bda4f6c0122e0 (patch) | |
tree | 4558ab588f41ed925a1fd0a71fef27fa6ba50125 | |
parent | d316c04345586ab35fae9680a069f946a5ade580 (diff) |
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.
-rw-r--r-- | src/virt-viewer-session-spice.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/virt-viewer-session-spice.c b/src/virt-viewer-session-spice.c index da193ec..717d229 100644 --- a/src/virt-viewer-session-spice.c +++ b/src/virt-viewer-session-spice.c @@ -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); } |