diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2006-08-21 15:03:02 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2006-08-21 15:03:02 +0000 |
| commit | 555f7760777fccfa56763d7c45a0378bba01d2e4 (patch) | |
| tree | 74883b07acba5280058d7409b512978736a07306 /src | |
| parent | ddfe7bb5b62632fd96adbb241b4b4eb096fe5920 (diff) | |
Fixed uninitialized data in OS X and WIN32 timout functions (STR #1374).
Fixed silly but in preferences test (that was unrelated to Fl_Preferences).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5341 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_win32.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx index 3f6e3a052..7b615dbc2 100644 --- a/src/Fl_win32.cxx +++ b/src/Fl_win32.cxx @@ -639,12 +639,13 @@ static void realloc_timers() if (win32_timer_alloc == 0) { win32_timer_alloc = 8; } - Win32Timer* new_timers = new Win32Timer[win32_timer_alloc * 2]; - memmove(new_timers, win32_timers, sizeof(Win32Timer) * win32_timer_used); + win32_timer_alloc *= 2; + Win32Timer* new_timers = new Win32Timer[win32_timer_alloc]; + memset(new_timers, 0, sizeof(Win32Timer) * win32_timer_used); + memcpy(new_timers, win32_timers, sizeof(Win32Timer) * win32_timer_used); Win32Timer* delete_me = win32_timers; win32_timers = new_timers; delete [] delete_me; - win32_timer_alloc *= 2; } static void delete_timer(Win32Timer& t) |
