[Spice-devel,v2,05/19] Do not leak mig_timer

Submitted by Frediano Ziglio on Nov. 25, 2016, 2:52 p.m.

Details

Message ID 4e240f069676d1b6be76d6c3ecf9541fa3011047.1480085518.git-series.fziglio@redhat.com
State New
Headers show
Series "Start cleaning objects on destruction" ( rev: 4 3 2 ) in Spice

Not browsing as part of any series.

Commit Message

Frediano Ziglio Nov. 25, 2016, 2:52 p.m.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
---
 server/reds.c | 4 ++++
 1 file changed, 4 insertions(+)

Patch hide | download patch | download mbox

diff --git a/server/reds.c b/server/reds.c
index 1a812e4..bc0cc01 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -3594,6 +3594,10 @@  SPICE_GNUC_VISIBLE void spice_server_destroy(SpiceServer *reds)
     }
     reds_cleanup(reds);
 
+    if (reds->mig_timer) {
+        reds_core_timer_remove(reds, reds->mig_timer);
+    }
+
     /* remove the server from the list of servers so that we don't attempt to
      * free it again at exit */
     pthread_mutex_lock(&global_reds_lock);

Comments

On Fri, 2016-11-25 at 14:52 +0000, Frediano Ziglio wrote:
> Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
> ---
>  server/reds.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/server/reds.c b/server/reds.c
> index 1a812e4..bc0cc01 100644
> --- a/server/reds.c
> +++ b/server/reds.c
> @@ -3594,6 +3594,10 @@ SPICE_GNUC_VISIBLE void
> spice_server_destroy(SpiceServer *reds)
>      }
>      reds_cleanup(reds);
>  
> +    if (reds->mig_timer) {
> +        reds_core_timer_remove(reds, reds->mig_timer);
> +    }
> +
>      /* remove the server from the list of servers so that we don't
> attempt to
>       * free it again at exit */
>      pthread_mutex_lock(&global_reds_lock);