Skip to contentSkip to conversation

main: allocate gui_timer only once.

PATCH Applied Isaku Yamahata 2 participants 2 messages May 27, 2010 – Jun 10, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 main: allocate gui_timer only once.

fix memory leak.
there is no need to allocate more than one gui_timer.

---
 vl.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
vl.c +1 -0
index 417554f..22cdf43 100644
@@ -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;
     }
Signature · 1 line
1.6.6.1
Applied
#1 lore raw

Thanks, applied.

Quoted 25 lines · Isaku Yamahata

fix memory leak.
there is no need to allocate more than one gui_timer.

---
 vl.c |    1 +

 1 files changed, 1 insertions(+), 0 deletions(-)
vl.c +1 -1
index 417554f..22cdf43 100644
@@ -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