diff src/event-Xt.c @ 3949:33b9323388c5

[xemacs-hg @ 2007-05-12 10:59:15 by aidan] Zero out device modifier map after freeing it, X11, GTK.
author aidan
date Sat, 12 May 2007 10:59:17 +0000
parents 4cad7ff4a200
children 930bb9cba65a
line wrap: on
line diff
--- a/src/event-Xt.c	Sat May 12 10:17:09 2007 +0000
+++ b/src/event-Xt.c	Sat May 12 10:59:17 2007 +0000
@@ -323,7 +323,14 @@
   xd->lock_interpretation = 0;
 
   if (xd->x_modifier_keymap)
-    XFreeModifiermap (xd->x_modifier_keymap);
+    {
+      XFreeModifiermap (xd->x_modifier_keymap);
+      /* Set it to NULL in case we receive two MappingModifier events in a
+         row, and the second is processed during some CHECK_QUITs within
+         x_reset_key_mapping. If that happens, XFreeModifierMap will be
+         called twice on the same map, and we crash.  */
+      xd->x_modifier_keymap = NULL;
+    }
 
   x_reset_key_mapping (d);