I hope this is The Right Patch now.
For me this fixes the problem on Solaris and Linux.
1998-08-26 Gunnar Evermann <Gunnar.Evermann(a)nats.informatik.uni-hamburg.de>
* frame-x.c (x_delete_frame): Flush the X output buffer after
calling XtDestroyWidget to ensure that the windows are really
killed right now.
--- frame-x.c~ Sat Jun 13 06:28:48 1998
+++ frame-x.c Wed Aug 26 13:16:49 1998
@@ -2651,6 +2651,7 @@
}
#else
XtDestroyWidget (w);
+ XFlush (XtDisplay(w)); /* make sure the windows are really gone! */
#endif /* EXTERNAL_WIDGET */
if (FRAME_X_GEOM_FREE_ME_PLEASE (f))