# HG changeset patch
# User omajid
# Date 1285601403 14400
# Node ID bbadb9484f537ce1e6ecf6e0d1f130235367c7e4
# Parent  278c8daa30750577cadb47f7c6c827d2dfb7d0bd
6986968: Crash on XIM server restart
Summary: Free XIM data structures on DestroyXIMCallback
Reviewed-by: naoto

diff -r 278c8daa3075 -r bbadb9484f53 src/solaris/native/sun/awt/awt_InputMethod.c
--- openjdk/jdk/src/solaris/native/sun/awt/awt_InputMethod.c	Mon Sep 27 13:38:49 2010 +0400
+++ openjdk/jdk/src/solaris/native/sun/awt/awt_InputMethod.c	Mon Sep 27 11:30:03 2010 -0400
@@ -1473,6 +1473,10 @@
 static void DestroyXIMCallback(XIM im, XPointer client_data, XPointer call_data) {
     /* mark that XIM server was destroyed */
     X11im = NULL;
+    JNIEnv* env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
+    /* free the old pX11IMData and set it to null. this also avoids crashing
+     * the jvm if the XIM server reappears */
+    X11InputMethodData *pX11IMData = getX11InputMethodData(env, currentX11InputMethodInstance);
 }
 
 /*
