diff options
author | hobbs <hobbs> | 2002-06-17 19:42:11 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2002-06-17 19:42:11 (GMT) |
commit | a984d974f6b3123815d8116428afe8e51e025f31 (patch) | |
tree | 5036a51a05492cc5c04cd0e055be4139a3e148c3 | |
parent | be006e554867bd4ea627978a313c7448a4a12843 (diff) | |
download | tk-a984d974f6b3123815d8116428afe8e51e025f31.zip tk-a984d974f6b3123815d8116428afe8e51e025f31.tar.gz tk-a984d974f6b3123815d8116428afe8e51e025f31.tar.bz2 |
* unix/tkUnixSend.c (TkSendCleanup): special cleanup of
inputContext to avoid bug in XCloseIM. (dejong)
-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); |