* src/w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
authorJason Rumney <jasonr@gnu.org>
Fri, 8 Jul 2011 12:46:17 +0000 (20:46 +0800)
committerJason Rumney <jasonr@gnu.org>
Fri, 8 Jul 2011 12:46:17 +0000 (20:46 +0800)
frame struct members of non-existent frames.

Fixes: debbugs:6284

src/ChangeLog
src/w32fns.c

index 89f5e0e..c489560 100644 (file)
@@ -1,3 +1,8 @@
+2011-07-08  Jason Rumney  <jasonr@gnu.org>
+
+       * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
+       frame struct members of non-existent frames (Bug#6284).
+
 2011-07-08  Jan Djärv  <jan.h.d@swipnet.se>
 
        * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
index cba0b91..f48e576 100644 (file)
@@ -3273,7 +3273,8 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
            {
              /* Free memory used by owner-drawn and help-echo strings.  */
              w32_free_menu_strings (hwnd);
-             f->output_data.w32->menubar_active = 0;
+             if (f)
+               f->output_data.w32->menubar_active = 0;
               menubar_in_use = 0;
            }
        }
@@ -3623,10 +3624,10 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
       if (LOWORD (lParam) == HTCLIENT)
        {
          f = x_window_to_frame (dpyinfo, hwnd);
-         if (f->output_data.w32->hourglass_p && !menubar_in_use
-             && !current_popup_menu)
+         if (f && f->output_data.w32->hourglass_p
+             && !menubar_in_use && !current_popup_menu)
            SetCursor (f->output_data.w32->hourglass_cursor);
-         else
+         else if (f)
            SetCursor (f->output_data.w32->current_cursor);
          return 0;
        }