[Spice-commits] server/inputs-channel.c

Frediano Ziglio fziglio at kemper.freedesktop.org
Wed Nov 30 13:01:10 UTC 2016


 server/inputs-channel.c |   13 +++++++++++++
 1 file changed, 13 insertions(+)

New commits:
commit e1cc694a729b44d81674c0d54edd456c0f474744
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Fri Nov 18 09:03:24 2016 +0000

    Avoid to leak timer in InputsChannel
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Pavel Grunt <pgrunt at redhat.com>

diff --git a/server/inputs-channel.c b/server/inputs-channel.c
index 7c397a4..99c2888 100644
--- a/server/inputs-channel.c
+++ b/server/inputs-channel.c
@@ -620,6 +620,18 @@ inputs_channel_constructed(GObject *object)
 }
 
 static void
+inputs_channel_finalize(GObject *object)
+{
+    InputsChannel *self = INPUTS_CHANNEL(object);
+    RedsState *reds = red_channel_get_server(RED_CHANNEL(self));
+
+    if (self->key_modifiers_timer) {
+        reds_core_timer_remove(reds, self->key_modifiers_timer);
+    }
+    G_OBJECT_CLASS(inputs_channel_parent_class)->finalize(object);
+}
+
+static void
 inputs_channel_init(InputsChannel *self)
 {
 }
@@ -632,6 +644,7 @@ inputs_channel_class_init(InputsChannelClass *klass)
     RedChannelClass *channel_class = RED_CHANNEL_CLASS(klass);
 
     object_class->constructed = inputs_channel_constructed;
+    object_class->finalize = inputs_channel_finalize;
 
     channel_class->parser = spice_get_client_channel_parser(SPICE_CHANNEL_INPUTS, NULL);
     channel_class->handle_parsed = inputs_channel_handle_parsed;


More information about the Spice-commits mailing list