all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lennart Borgman <lennart.borgman@gmail.com>
To: Juanma Barranquero <lekktu@gmail.com>, Eli Zaretskii <eliz@gnu.org>
Cc: 6284@debbugs.gnu.org
Subject: bug#6284: Crash in w32_wnd_proc at frame deletion
Date: Sat, 29 May 2010 01:44:01 +0200	[thread overview]
Message-ID: <AANLkTikP1CLy3IR87WZ8r5cF-Ox__taPs0oyL0TJvX7q@mail.gmail.com> (raw)
In-Reply-To: <AANLkTikW9aMxOMOimCLqMVFK06xaGObjp_DaCKle7yeJ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 457 bytes --]

New patch. I missed one place in the previous patch and this just hit me.

It is great running under the debugger and finally being able to find
and fix those bugs I have wondered about quite long now but have not
had time to fix before.

The only problem now is how to get them installed. As I said elsewhere
I currently have no checkout from savannah so I can't checkin the
patches myself AFAIK. Should I get a second checkout from savannah for
this, or?

[-- Attachment #2: bug6284-2.diff --]
[-- Type: text/x-patch, Size: 3915 bytes --]


C:\emacs-lp\bld\emacs\bug6284>bzr diff --old c:\emacs-lp\bld\emacs\trunk -p trunk/:bug6284/ 
=== modified file 'src/w32fns.c'
--- trunk/src/w32fns.c	2010-05-11 21:02:32 +0000
+++ bug6284/src/w32fns.c	2010-05-28 23:32:20 +0000
@@ -3195,6 +3195,9 @@
 	    break;
 
 	  f = x_window_to_frame (dpyinfo, hwnd);
+          if (!f)
+            break;
+
 	  w = XWINDOW (FRAME_SELECTED_WINDOW (f));
 
 	  form.dwStyle = CFS_RECT;
@@ -3349,8 +3352,10 @@
 
 	/* Ignore middle and extra buttons as long as the menu is active.  */
 	f = x_window_to_frame (dpyinfo, hwnd);
-	if (f && f->output_data.w32->menubar_active)
-	  return 0;
+        if (!f)
+          return 0;
+	if (f->output_data.w32->menubar_active)
+          return 0;
 
 	if (parse_button (msg, HIWORD (wParam), &button, &up))
 	  {
@@ -3379,7 +3384,9 @@
 	 it's wrong to handle them as if they happened on the
 	 underlying frame.  */
       f = x_window_to_frame (dpyinfo, hwnd);
-      if (f && f->output_data.w32->menubar_active)
+      if (!f)
+        return 0;
+      if (f->output_data.w32->menubar_active)
 	return 0;
 
       /* If the mouse has just moved into the frame, start tracking
@@ -3475,6 +3482,8 @@
 	  KillTimer (hwnd, menu_free_timer);
 	  menu_free_timer = 0;
 	  f = x_window_to_frame (dpyinfo, hwnd);
+          if (!f)
+            return 0;
           /* If a popup menu is active, don't wipe its strings.  */
 	  if (menubar_in_use
               && current_popup_menu == NULL)
@@ -3489,7 +3498,10 @@
 	{
 	  KillTimer (hwnd, hourglass_timer);
 	  hourglass_timer = 0;
-	  w32_show_hourglass (x_window_to_frame (dpyinfo, hwnd));
+	  f = x_window_to_frame (dpyinfo, hwnd);
+          if (!f)
+            return 0;
+	  w32_show_hourglass (f);
 	}
       return 0;
 
@@ -3522,14 +3534,15 @@
 	 being active).  */
 
       f = x_window_to_frame (dpyinfo, hwnd);
-      if (f
-	  && (f->output_data.w32->menubar_active
-	      /* We can receive this message even in the absence of a
-		 menubar (ie. when the system menu is activated) - in this
-		 case we do NOT want to forward the message, otherwise it
-		 will cause the menubar to suddenly appear when the user
-		 had requested it to be turned off!  */
-	      || f->output_data.w32->menubar_widget == NULL))
+      if (!f)
+        return 0;
+      if (f->output_data.w32->menubar_active
+          /* We can receive this message even in the absence of a
+             menubar (ie. when the system menu is activated) - in this
+             case we do NOT want to forward the message, otherwise it
+             will cause the menubar to suddenly appear when the user
+             had requested it to be turned off!  */
+          || f->output_data.w32->menubar_widget == NULL)
 	return 0;
 
       {
@@ -3831,6 +3844,8 @@
       if (LOWORD (lParam) == HTCLIENT)
 	{
 	  f = x_window_to_frame (dpyinfo, hwnd);
+          if (!f)
+            return 0;
 	  if (f->output_data.w32->hourglass_p && !menubar_in_use
 	      && !current_popup_menu)
 	    SetCursor (f->output_data.w32->hourglass_cursor);

=== modified file 'src/w32term.c'
--- trunk/src/w32term.c	2010-04-10 16:28:30 +0000
+++ bug6284/src/w32term.c	2010-05-27 20:06:13 +0000
@@ -4375,7 +4375,7 @@
 	 But it was originally changed to this to fix a bug, so I have
 	 not removed it completely in case the bug is still there.  */
           if (help_echo_string != previous_help_echo_string ||
-	      (!NILP (help_echo_string) && !STRINGP (help_echo_string) && f->mouse_moved))
+	      (!NILP (help_echo_string) && !STRINGP (help_echo_string) && f && f->mouse_moved))
 #else /* This is what xterm.c does.  */
 	    if (!NILP (help_echo_string)
 		|| !NILP (previous_help_echo_string))
@@ -4554,7 +4554,8 @@
 	  else
 	    {
 	      f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
-	      f->async_visible = msg.msg.wParam;
+              if (f)
+                f->async_visible = msg.msg.wParam;
 	    }
 #endif
 


  reply	other threads:[~2010-05-28 23:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-27 17:44 bug#6284: Crash in w32_wnd_proc at frame deletion Lennart Borgman
2010-05-27 18:26 ` Juanma Barranquero
2010-05-27 18:34   ` Lennart Borgman
2010-05-27 22:33     ` Lennart Borgman
2010-05-28 23:44       ` Lennart Borgman [this message]
2011-07-08 12:53         ` Jason Rumney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTikP1CLy3IR87WZ8r5cF-Ox__taPs0oyL0TJvX7q@mail.gmail.com \
    --to=lennart.borgman@gmail.com \
    --cc=6284@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=lekktu@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.