[Spice-devel,v3,3/7] Free QXL instances in spice_server_destroy

Submitted by Frediano Ziglio on Dec. 1, 2016, 11:09 a.m.

Details

Message ID 5bca237d59f8986a8e70f579b1eb24f37b80b3f2.1480590563.git-series.fziglio@redhat.com
State Superseded
Headers show
Series "Start cleaning objects on destruction" ( rev: 5 ) in Spice

Not browsing as part of any series.

Commit Message

Frediano Ziglio Dec. 1, 2016, 11:09 a.m.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
---
 server/reds.c | 7 +++++++
 1 file changed, 7 insertions(+)

Patch hide | download patch | download mbox

diff --git a/server/reds.c b/server/reds.c
index 17e5ada..d350331 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -3592,6 +3592,8 @@  SPICE_GNUC_VISIBLE void spice_server_destroy(SpiceServer *reds)
     servers = g_list_remove(servers, reds);
     pthread_mutex_unlock(&global_reds_lock);
 
+    g_list_free_full(reds->qxl_instances, (GDestroyNotify)red_qxl_destroy);
+
     if (reds->inputs_channel) {
         reds_unregister_channel(reds, RED_CHANNEL(reds->inputs_channel));
         red_channel_destroy(RED_CHANNEL(reds->inputs_channel));
@@ -3600,6 +3602,11 @@  SPICE_GNUC_VISIBLE void spice_server_destroy(SpiceServer *reds)
         red_channel_destroy(RED_CHANNEL(reds->main_channel));
     }
     reds_core_timer_remove(reds, reds->mig_timer);
+
+    if (reds->main_dispatcher) {
+        g_object_unref(reds->main_dispatcher);
+    }
+
     reds_cleanup(reds);
 #ifdef RED_STATISTICS
     stat_file_free(reds->stat_file);

Comments

On Thu, 2016-12-01 at 11:09 +0000, Frediano Ziglio wrote:
> Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
> ---
>  server/reds.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/server/reds.c b/server/reds.c
> index 17e5ada..d350331 100644
> --- a/server/reds.c
> +++ b/server/reds.c
> @@ -3592,6 +3592,8 @@ SPICE_GNUC_VISIBLE void
> spice_server_destroy(SpiceServer *reds)
>      servers = g_list_remove(servers, reds);
>      pthread_mutex_unlock(&global_reds_lock);
>  
> +    g_list_free_full(reds->qxl_instances,
> (GDestroyNotify)red_qxl_destroy);
> +
>      if (reds->inputs_channel) {
>          reds_unregister_channel(reds, RED_CHANNEL(reds-
> >inputs_channel));
>          red_channel_destroy(RED_CHANNEL(reds->inputs_channel));
> @@ -3600,6 +3602,11 @@ SPICE_GNUC_VISIBLE void
> spice_server_destroy(SpiceServer *reds)
>          red_channel_destroy(RED_CHANNEL(reds->main_channel));
>      }
>      reds_core_timer_remove(reds, reds->mig_timer);
> +
> +    if (reds->main_dispatcher) {
> +        g_object_unref(reds->main_dispatcher);
> +    }
> +

This chunk appears unrelated to the qxl instances and is not mentioned
anywhere in the commit log. I'm not necessarily opposed to adding both
of these things in the same patch, but then the log should mention them
both.

Jonathon



>      reds_cleanup(reds);
>  #ifdef RED_STATISTICS
>      stat_file_free(reds->stat_file);