diff src/os_unix.c @ 6458:48111d5fd8a8 v7.4.558

updated for version 7.4.558 Problem: When the X server restarts Vim may get stuck. Solution: Destroy the application context and create it again. (Issue 203)
author Bram Moolenaar <bram@vim.org>
date Wed, 17 Dec 2014 17:59:31 +0100
parents e13f8073c9f9
children 781104cb0d06
line wrap: on
line diff
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -1617,6 +1617,17 @@ may_restore_clipboard()
     if (xterm_dpy_was_reset)
     {
 	xterm_dpy_was_reset = FALSE;
+
+# ifndef LESSTIF_VERSION
+	/* This has been reported to avoid Vim getting stuck. */
+	if (app_context != (XtAppContext)NULL)
+	{
+	    XtDestroyApplicationContext(app_context);
+	    app_context = (XtAppContext)NULL;
+	    x11_display = NULL; /* freed by XtDestroyApplicationContext() */
+	}
+# endif
+
 	setup_term_clip();
 	get_x11_title(FALSE);
     }