summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2013-01-29 18:23:52 +0100
committerMarc-André Lureau <marcandre.lureau@redhat.com>2013-01-29 18:23:52 +0100
commitb170b7f618622f71f2e6b7b1ae65d24f25039c73 (patch)
tree6e5798cc5315c9f61a9b42ea621f77d4a5f89c83
parent5ad2fa098be217a19844a504236053ad107372e1 (diff)
session: clear SpiceSession:proxy also if SPICE_PROXY is NULL
-rw-r--r--gtk/spice-session.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gtk/spice-session.c b/gtk/spice-session.c
index 299bebc..ccc9367 100644
--- a/gtk/spice-session.c
+++ b/gtk/spice-session.c
@@ -127,15 +127,17 @@ static void update_proxy(SpiceSession *self, const gchar *str)
if (str == NULL)
str = g_getenv("SPICE_PROXY");
- if (str == NULL || *str == 0)
+ if (str == NULL || *str == 0) {
+ g_clear_object(&s->proxy);
return;
+ }
proxy = spice_proxy_new();
if (!spice_proxy_parse(proxy, str, &error))
g_clear_object(&proxy);
if (error) {
- g_warning ("%s", error->message);
- g_clear_error (&error);
+ g_warning("%s", error->message);
+ g_clear_error(&error);
}
if (proxy != NULL) {