--- rxvt-unicode/src/main.C 2004/08/04 03:29:28 1.76 +++ rxvt-unicode/src/main.C 2004/08/10 20:39:19 1.77 @@ -203,6 +203,9 @@ { selection_clear (); +#ifdef USE_XIM + im_destroy (); +#endif #ifdef MENUBAR if (menubarGC) XFreeGC (display->display, menubarGC); #endif @@ -276,13 +279,12 @@ void rxvt_term::destroy () { + if (destroy_ev.active) + return; + if (display) { - rootwin_ev.stop (display); - termwin_ev.stop (display); - vt_ev.stop (display); #ifdef USE_XIM - im_destroy (); im_ev.stop (display); #endif #ifdef HAVE_SCROLLBARS @@ -291,6 +293,9 @@ #ifdef MENUBAR menubar_ev.stop (display); #endif + rootwin_ev.stop (display); + termwin_ev.stop (display); + vt_ev.stop (display); } check_ev.stop ();