diff options
Diffstat (limited to 'unix/tkUnixSend.c')
-rw-r--r-- | unix/tkUnixSend.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/unix/tkUnixSend.c b/unix/tkUnixSend.c index 4962e71..843360a 100644 --- a/unix/tkUnixSend.c +++ b/unix/tkUnixSend.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkUnixSend.c,v 1.6 2002/04/12 10:19:49 hobbs Exp $ + * RCS: @(#) $Id: tkUnixSend.c,v 1.7 2002/06/17 19:42:11 hobbs Exp $ */ #include "tkPort.h" @@ -1275,9 +1275,21 @@ void TkSendCleanup(dispPtr) TkDisplay *dispPtr; { + TkWindow *winPtr = (TkWindow *) dispPtr->commTkwin; + if (dispPtr->commTkwin != NULL) { - Tk_DeleteEventHandler(dispPtr->commTkwin, PropertyChangeMask, - SendEventProc, (ClientData) dispPtr); + Tk_DeleteEventHandler((Tk_Window) winPtr, PropertyChangeMask, + SendEventProc, (ClientData) dispPtr); + + /* + * We need to manually free all the XIC structures that + * have been allocated in order to avoid a nasty bug in XCloseIM(). + */ + if (winPtr->inputContext != NULL) { + XDestroyIC(winPtr->inputContext); + winPtr->inputContext = NULL; + } + #ifdef PURIFY /* Tk_DestroyWindow(dispPtr->commTkwin); */ ckfree((char *) dispPtr->commTkwin); |