[Spice-devel,v5,4/8] Free main_dispatcher in spice_server_destroy

Submitted by Frediano Ziglio on Dec. 5, 2016, 12:16 p.m.

Details

Message ID a54f0377a3a96a3f4d0ef7aa8664e9775108b7ad.1480940153.git-series.fziglio@redhat.com
State Accepted
Commit 74fa5e3fe49724f0f1056189c6cad15234d58414
Headers show
Series "Start cleaning objects on destruction" ( rev: 7 ) in Spice

Not browsing as part of any series.

Commit Message

Frediano Ziglio Dec. 5, 2016, 12:16 p.m.
Avoid leaking it.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
---
 server/reds.c | 5 +++++
 1 file changed, 5 insertions(+)

Patch hide | download patch | download mbox

diff --git a/server/reds.c b/server/reds.c
index 95295c8..d350331 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -3602,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

Acked-by: Jonathon Jongsma <jjongsma@redhat.com>


On Mon, 2016-12-05 at 12:16 +0000, Frediano Ziglio wrote:
> Avoid leaking it.
> 
> Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
> ---
>  server/reds.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/server/reds.c b/server/reds.c
> index 95295c8..d350331 100644
> --- a/server/reds.c
> +++ b/server/reds.c
> @@ -3602,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);