main: allocate gui_timer only once.
authorIsaku Yamahata <yamahata@valinux.co.jp>
Thu, 27 May 2010 05:38:47 +0000 (14:38 +0900)
committerBlue Swirl <blauwirbel@gmail.com>
Thu, 10 Jun 2010 16:48:06 +0000 (16:48 +0000)
fix memory leak.
there is no need to allocate more than one gui_timer.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
vl.c

diff --git a/vl.c b/vl.c
index 6d08ec834aef04681d76539b9056eae23ca7ec93..3d7ce522b184ab5e544046036702aaf37ffcd2b0 100644 (file)
--- 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;
     }