Patchwork main: allocate gui_timer only once.

login
register
mail settings
Submitter Isaku Yamahata
Date May 27, 2010, 5:38 a.m.
Message ID <20100527053847.GD31807@valinux.co.jp>
Download mbox | patch
Permalink /patch/53687/
State New
Headers show

Comments

Isaku Yamahata - May 27, 2010, 5:38 a.m.
fix memory leak.
there is no need to allocate more than one gui_timer.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
---
 vl.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
Blue Swirl - June 10, 2010, 6:15 p.m.
Thanks, applied.

On Thu, May 27, 2010 at 5:38 AM, Isaku Yamahata <yamahata@valinux.co.jp> wrote:
> fix memory leak.
> there is no need to allocate more than one gui_timer.
>
> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
> ---
>  vl.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/vl.c b/vl.c
> index 417554f..22cdf43 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -3794,6 +3794,7 @@ int main(int argc, char **argv, char **envp)
>         if (dcl->dpy_refresh != NULL) {
>             ds->gui_timer = qemu_new_timer(rt_clock, gui_update, ds);
>             qemu_mod_timer(ds->gui_timer, qemu_get_clock(rt_clock));
> +            break;
>         }
>         dcl = dcl->next;
>     }
> --
> 1.6.6.1
>
>
>

Patch

diff --git a/vl.c b/vl.c
index 417554f..22cdf43 100644
--- a/vl.c
+++ b/vl.c
@@ -3794,6 +3794,7 @@  int main(int argc, char **argv, char **envp)
         if (dcl->dpy_refresh != NULL) {
             ds->gui_timer = qemu_new_timer(rt_clock, gui_update, ds);
             qemu_mod_timer(ds->gui_timer, qemu_get_clock(rt_clock));
+            break;
         }
         dcl = dcl->next;
     }