--- rxvt-unicode/src/main.C 2006/01/19 09:47:15 1.189 +++ rxvt-unicode/src/main.C 2006/01/20 12:16:28 1.192 @@ -50,10 +50,13 @@ vector rxvt_term::termlist; +// used to tell global functions which terminal instance is "active" +rxvt_t rxvt_current_term; + static char curlocale[128], savelocale[128]; bool -rxvt_set_locale (const char *locale) +rxvt_set_locale (const char *locale) NOTHROW { if (!locale || !strncmp (locale, curlocale, 128)) return false; @@ -64,14 +67,14 @@ } void -rxvt_push_locale (const char *locale) +rxvt_push_locale (const char *locale) NOTHROW { strcpy (savelocale, curlocale); rxvt_set_locale (locale); } void -rxvt_pop_locale () +rxvt_pop_locale () NOTHROW { rxvt_set_locale (savelocale); } @@ -184,9 +187,6 @@ #ifdef KEYSYM_RESOURCE keyboard = new keyboard_manager; - - if (!keyboard) - rxvt_fatal ("out of memory, aborting.\n"); #endif } @@ -202,8 +202,6 @@ rxvt_term::~rxvt_term () { - HOOK_INVOKE ((this, HOOK_DESTROY, DT_END)); - termlist.erase (find (termlist.begin (), termlist.end(), this)); emergency_cleanup (); @@ -306,6 +304,9 @@ if (destroy_ev.active) return; + if (HOOK_INVOKE ((this, HOOK_DESTROY, DT_END))) + return; + #if ENABLE_OVERLAY scr_overlay_off (); #endif @@ -470,19 +471,6 @@ scrollBar.setIdle (); /* set existence for size calculations */ #endif -#if ENABLE_PERL - if (!rs[Rs_perl_ext_1]) - rs[Rs_perl_ext_1] = "default"; - - if ((rs[Rs_perl_ext_1] && *rs[Rs_perl_ext_1]) - || (rs[Rs_perl_ext_2] && *rs[Rs_perl_ext_2]) - || (rs[Rs_perl_eval] && *rs[Rs_perl_eval])) - { - rxvt_perl.init (this); - HOOK_INVOKE ((this, HOOK_INIT, DT_END)); - } -#endif - pty = rxvt_new_ptytty (); create_windows (argc, argv); @@ -510,9 +498,6 @@ } #endif - XMapWindow (disp, vt); - XMapWindow (disp, parent[0]); - set_colorfgbg (); init_command (cmd_argv); @@ -526,6 +511,9 @@ HOOK_INVOKE ((this, HOOK_START, DT_END)); + XMapWindow (disp, vt); + XMapWindow (disp, parent[0]); + return true; } @@ -633,7 +621,7 @@ return p; } -void * +void * rxvt_realloc (void *ptr, size_t size) { void *p = realloc (ptr, size); @@ -1591,7 +1579,4 @@ } #endif /* USE_XIM */ -/*----------------------------------------------------------------------*/ -rxvt_t rxvt_current_term; - /*----------------------- end-of-file (C source) -----------------------*/