From 722493d794101ebabceb63bac72d94c4cae6e965 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Wed, 19 Mar 2014 19:43:18 +0200 Subject: [PATCH] Fix minor memory-related problems on MS-Windows revealed by Dr. Memory. src/w32fns.c (reset_modifiers): Zero out keystate[] before using it. (w32_wnd_proc): Initialize the dwHoverTime member of TRACKMOUSEEVENT structure. --- src/ChangeLog | 6 ++++++ src/w32fns.c | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 1330e5ed132..94859f1f8fd 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2014-03-19 Eli Zaretskii + + * w32fns.c (reset_modifiers): Zero out keystate[] before using it. + (w32_wnd_proc): Initialize the dwHoverTime member of + TRACKMOUSEEVENT structure. + 2014-03-17 Teodor Zlatanov * gnutls.c (Fgnutls_boot): Fix case of :verify-error = t. diff --git a/src/w32fns.c b/src/w32fns.c index 66f532c3721..a5b8abfa6b1 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -2099,6 +2099,7 @@ reset_modifiers (void) #define CURRENT_STATE(key) ((GetAsyncKeyState (key) & 0x8000) >> 8) + memset (keystate, 0, sizeof (keystate)); GetKeyboardState (keystate); keystate[VK_SHIFT] = CURRENT_STATE (VK_SHIFT); keystate[VK_CONTROL] = CURRENT_STATE (VK_CONTROL); @@ -3444,6 +3445,7 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) tme.cbSize = sizeof (tme); tme.dwFlags = TME_LEAVE; tme.hwndTrack = hwnd; + tme.dwHoverTime = HOVER_DEFAULT; track_mouse_event_fn (&tme); track_mouse_window = hwnd; -- 2.39.2