[Spice-devel] [PATCH 2/9] Free channels in RedsState destructor

Jonathon Jongsma jjongsma at redhat.com
Fri Oct 28 17:06:22 UTC 2016


RedsState is only freed at application exit, so this leak didn't matter
much in practice.
---
 server/reds.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/server/reds.c b/server/reds.c
index c03ed18..c2ac4d9 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -3681,8 +3681,12 @@ SPICE_GNUC_VISIBLE void spice_server_destroy(SpiceServer *reds)
     free(reds->config);
     if (reds->main_channel) {
         main_channel_close(reds->main_channel);
+        g_object_unref(reds->main_channel);
     }
 
+    if (reds->inputs_channel)
+        g_object_unref(reds->inputs_channel);
+
 #ifdef RED_STATISTICS
     if (reds->stat_shm_name) {
         shm_unlink(reds->stat_shm_name);
-- 
2.7.4



More information about the Spice-devel mailing list