diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2006-08-19 20:09:33 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2006-08-19 20:09:33 +0000 |
| commit | 660d5247006badd07e597194802807dc0fd74d05 (patch) | |
| tree | d4553afc766a024883cb2569f9f08b62918c9dc3 /src | |
| parent | dadcbb61b3e54b520bffe5910da51e7bba9966f6 (diff) | |
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
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_mac.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
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) |
