From 660d5247006badd07e597194802807dc0fd74d05 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Sat, 19 Aug 2006 20:09:33 +0000 Subject: Fixed unintialized data bug in OS X timeout functions. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5336 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_mac.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/Fl_mac.cxx b/src/Fl_mac.cxx index b710deb05..9f5a1a74c 100644 --- a/src/Fl_mac.cxx +++ b/src/Fl_mac.cxx @@ -623,12 +623,13 @@ static void realloc_timers() if (mac_timer_alloc == 0) { mac_timer_alloc = 8; } - MacTimeout* new_timers = new MacTimeout[mac_timer_alloc * 2]; - memmove(new_timers, mac_timers, sizeof(MacTimeout) * mac_timer_used); + mac_timer_alloc *= 2; + MacTimeout* new_timers = new MacTimeout[mac_timer_alloc]; + memset(new_timers, 0, sizeof(MacTimeout)*mac_timer_alloc); + memcpy(new_timers, mac_timers, sizeof(MacTimeout) * mac_timer_used); MacTimeout* delete_me = mac_timers; mac_timers = new_timers; delete [] delete_me; - mac_timer_alloc *= 2; } static void delete_timer(MacTimeout& t) -- cgit v1.2.3