summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2012-04-15 21:57:01 +0200
committerMarc-André Lureau <marcandre.lureau@redhat.com>2012-04-16 20:01:46 +0200
commitff7994ca59f9afffb028b7380b3deb587d84db0e (patch)
treee571a17e55617995efcc1819b23bbb0a02684365
parent1ee71103c5b4251e10b6e44d2fb3eafa332cfe89 (diff)
Clear cache and glz dictionnary on switch-host
If we don't clear the glz dictionnary, this might lead to corrupted/invalid dictionnary and invalid memory allocation due unbounded increase of dictionnary size
-rw-r--r--gtk/spice-session.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gtk/spice-session.c b/gtk/spice-session.c
index d30d089..02b35f3 100644
--- a/gtk/spice-session.c
+++ b/gtk/spice-session.c
@@ -1122,9 +1122,9 @@ gboolean spice_session_get_client_provided_socket(SpiceSession *session)
}
G_GNUC_INTERNAL
-void spice_session_switching_disconnect(SpiceSession *session)
+void spice_session_switching_disconnect(SpiceSession *self)
{
- SpiceSessionPrivate *s = SPICE_SESSION_GET_PRIVATE(session);
+ SpiceSessionPrivate *s = SPICE_SESSION_GET_PRIVATE(self);
struct channel *item;
RingItem *ring, *next;
@@ -1141,6 +1141,10 @@ void spice_session_switching_disconnect(SpiceSession *session)
}
g_warn_if_fail(!ring_is_empty(&s->channels)); /* ring_get_length() == 1 */
+
+ spice_session_palettes_clear(self);
+ spice_session_images_clear(self);
+ glz_decoder_window_clear(s->glz_window);
}
G_GNUC_INTERNAL