main: allocate gui_timer only once.

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>
This commit is contained in:
Isaku Yamahata 2010-05-27 14:38:47 +09:00 committed by Blue Swirl
parent 60a3992e75
commit 0f2ad63fcb

1
vl.c
View File

@ -3794,6 +3794,7 @@ int main(int argc, char **argv, char **envp)
if (dcl->dpy_refresh != NULL) { if (dcl->dpy_refresh != NULL) {
ds->gui_timer = qemu_new_timer(rt_clock, gui_update, ds); ds->gui_timer = qemu_new_timer(rt_clock, gui_update, ds);
qemu_mod_timer(ds->gui_timer, qemu_get_clock(rt_clock)); qemu_mod_timer(ds->gui_timer, qemu_get_clock(rt_clock));
break;
} }
dcl = dcl->next; dcl = dcl->next;
} }