summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2014-03-19 19:43:18 +0200
committerEli Zaretskii <eliz@gnu.org>2014-03-19 19:43:18 +0200
commit722493d794101ebabceb63bac72d94c4cae6e965 (patch)
treebdcd1e25391dc950fd5e6ddb98a1c1dbc9831ea5 /src
parentf88bdc45e02c8d6418b55102ec66cd446c956d93 (diff)
downloademacs-722493d794101ebabceb63bac72d94c4cae6e965.tar.gz
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.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog6
-rw-r--r--src/w32fns.c2
2 files changed, 8 insertions, 0 deletions
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 <eliz@gnu.org>
+
+ * 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 <tzz@lifelogs.com>
* 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;