Tk Source Code

Artifact [02be9cce]
Login

Artifact 02be9cce0c15c539b6bec1376ff9f6d78de7afbb:

Attachment "destroyic-earlier.patch" to ticket [630533ff] added by jenglish 2002-10-31 03:21:31.
Index: tkWindow.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/generic/tkWindow.c,v
retrieving revision 1.54
diff -c -r1.54 tkWindow.c
*** tkWindow.c	2 Sep 2002 19:16:23 -0000	1.54
--- tkWindow.c	30 Oct 2002 20:16:19 -0000
***************
*** 1286,1291 ****
--- 1286,1303 ----
  	tsdPtr->numMainWindows--;
      }
  
+ #ifdef TK_USE_INPUT_METHODS
+     /* 
+      * Free the input context, if any.
+      * This needs to be done early, in case a <Destroy> binding calls [exit];
+      * the Unix exit sequence expects all input contexts to be freed.
+      */
+     if (winPtr->inputContext != NULL) {
+ 	XDestroyIC(winPtr->inputContext);
+ 	winPtr->inputContext = NULL;
+     }
+ #endif /* TK_USE_INPUT_METHODS */
+ 
      /*
       * Recursively destroy children.
       */
***************
*** 1392,1403 ****
      UnlinkWindow(winPtr);
      TkEventDeadWindow(winPtr);
      TkBindDeadWindow(winPtr);
! #ifdef TK_USE_INPUT_METHODS
!     if (winPtr->inputContext != NULL) {
! 	XDestroyIC(winPtr->inputContext);
! 	winPtr->inputContext = NULL;
!     }
! #endif /* TK_USE_INPUT_METHODS */
      if (winPtr->tagPtr != NULL) {
  	TkFreeBindingTags(winPtr);
      }
--- 1404,1410 ----
      UnlinkWindow(winPtr);
      TkEventDeadWindow(winPtr);
      TkBindDeadWindow(winPtr);
! 
      if (winPtr->tagPtr != NULL) {
  	TkFreeBindingTags(winPtr);
      }