diff src/event-msw.c @ 298:70ad99077275 r21-0b47

Import from CVS: tag r21-0b47
author cvs
date Mon, 13 Aug 2007 10:39:40 +0200
parents 4b85ae5eabfb
children 33bdb3d4b97f
line wrap: on
line diff
--- a/src/event-msw.c	Mon Aug 13 10:38:47 2007 +0200
+++ b/src/event-msw.c	Mon Aug 13 10:39:40 2007 +0200
@@ -881,7 +881,7 @@
   mswindows_enqueue_dispatch_event (event);
 }
 
-static void
+void
 mswindows_enqueue_magic_event (HWND hwnd, UINT message)
 {
   Lisp_Object emacs_event = Fmake_event (Qnil, Qnil);
@@ -1917,9 +1917,13 @@
 	      mswindows_size_frame_internal ( frame, 
 					      FRAME_MSWINDOWS_TARGET_RECT 
 					      (frame));
-	      /* Reset to we do not get here again */
-	      xfree (FRAME_MSWINDOWS_TARGET_RECT (frame));
-	      FRAME_MSWINDOWS_TARGET_RECT (frame) = 0;
+	      /* Reset so we do not get here again. The SetWindowPos call in
+	       * mswindows_size_frame_internal can cause recursion here. */
+	      if (FRAME_MSWINDOWS_TARGET_RECT (frame))
+		{
+		  xfree (FRAME_MSWINDOWS_TARGET_RECT (frame));
+		  FRAME_MSWINDOWS_TARGET_RECT (frame) = 0;
+		}
 	    }
 	  else
 	    {