summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Fl_mac.cxx7
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)