]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix minor memory-related problems on MS-Windows revealed by Dr. Memory.
authorEli Zaretskii <eliz@gnu.org>
Wed, 19 Mar 2014 17:43:18 +0000 (19:43 +0200)
committerEli Zaretskii <eliz@gnu.org>
Wed, 19 Mar 2014 17:43:18 +0000 (19:43 +0200)
 src/w32fns.c (reset_modifiers): Zero out keystate[] before using it.
 (w32_wnd_proc): Initialize the dwHoverTime member of
 TRACKMOUSEEVENT structure.

src/ChangeLog
src/w32fns.c

index 1330e5ed132ada4df0f5a9d6599e78a10b1b6b19..94859f1f8fd8252f65ee90c3c530b35fbad79cea 100644 (file)
@@ -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.
index 66f532c3721272779babdcce8741dda4a91e27db..a5b8abfa6b1f6d24c41a273d718409df25585194 100644 (file)
@@ -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;