summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathon Jongsma <jjongsma@redhat.com>2015-02-20 17:14:47 -0600
committerFabiano FidĂȘncio <fidencio@redhat.com>2015-02-23 23:00:47 +0100
commit150f0f517fc400e983a7cf8c6a12b1a3322dda3d (patch)
treec3aadf9a51e716025a3970f80b053a19e8e5ffc4
parent816b3f95288e0c8e3a06dd653cb2e82a88c94647 (diff)
downloadspice-replay-rebase.zip
spice-replay-rebase.tar.gz
spice-replay-rebase.tar.xz
Free dispatchers at exitreplay-rebase
-rw-r--r--server/red-dispatcher.c7
-rw-r--r--server/red-dispatcher.h1
-rw-r--r--server/reds.c2
3 files changed, 10 insertions, 0 deletions
diff --git a/server/red-dispatcher.c b/server/red-dispatcher.c
index 44b1334..d812339 100644
--- a/server/red-dispatcher.c
+++ b/server/red-dispatcher.c
@@ -861,6 +861,13 @@ void red_dispatcher_async_complete(struct RedDispatcher *dispatcher,
free(async_command);
}
+void red_dispatcher_free(RedDispatcher *self)
+{
+ g_object_unref(self->dispatcher);
+ /* FIXME: free other stuff */
+ free(self);
+}
+
RedDispatcher *red_dispatcher_new(RedsState *reds, QXLInstance *qxl, int compression_level)
{
RedDispatcher *red_dispatcher;
diff --git a/server/red-dispatcher.h b/server/red-dispatcher.h
index 35b0ab8..5f8ec6d 100644
--- a/server/red-dispatcher.h
+++ b/server/red-dispatcher.h
@@ -27,6 +27,7 @@ typedef struct RedChannelClient RedChannelClient;
typedef struct AsyncCommand AsyncCommand;
RedDispatcher *red_dispatcher_new(RedsState *reds, QXLInstance *qxl, int compression_level);
+void red_dispatcher_free(RedDispatcher *self);
void red_dispatcher_set_mm_time(RedDispatcher *dispatcher, uint32_t);
void red_dispatcher_on_ic_change(RedDispatcher *dispatcher, spice_image_compression_t ic);
diff --git a/server/reds.c b/server/reds.c
index d6e1b21..4990dfe 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -2636,9 +2636,11 @@ static int reds_init_ssl(RedsState *reds)
static void reds_destroy_internal(RedsState *reds)
{
g_array_unref(reds->renderers);
+ g_object_unref(reds->main_dispatcher);
if (reds->main_channel) {
main_channel_close(reds->main_channel);
}
+ g_list_free_full(reds->dispatchers, (GDestroyNotify)red_dispatcher_free);
#ifdef RED_STATISTICS
shm_unlink(reds->stat_shm_name);
free(reds->stat_shm_name);