summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhobbs <hobbs>2002-06-17 19:42:11 (GMT)
committerhobbs <hobbs>2002-06-17 19:42:11 (GMT)
commit5a3dc0560d0a0a956789b8a0fa5a8ae4a07e1067 (patch)
tree5036a51a05492cc5c04cd0e055be4139a3e148c3
parent72ebed7f77a8b92f206ad79b043e0ad5bea0b311 (diff)
downloadtk-5a3dc0560d0a0a956789b8a0fa5a8ae4a07e1067.zip
tk-5a3dc0560d0a0a956789b8a0fa5a8ae4a07e1067.tar.gz
tk-5a3dc0560d0a0a956789b8a0fa5a8ae4a07e1067.tar.bz2
* unix/tkUnixSend.c (TkSendCleanup): special cleanup of
inputContext to avoid bug in XCloseIM. (dejong)
-rw-r--r--unix/tkUnixSend.c18
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);