crashes when you kill your input method (xterm crashes, too).
- fix bugs in x flushing, causing an empty screen after startup
the first until the first event arives.
- - fix ~15kb memleak per term in rxvtd.
+ - fix various memleaks in rxvtd.
1.8 Mon Feb 2 20:09:18 CET 2004
- almost total conversion to C++. Except for introducing
if (f)
{
- // the font should really exists now. if not, we have a problem
+ // the font should really exist now. if not, we have a problem
// (e.g. if the user did xset fp rehash just when we were searching fonts).
// in that case, just return garbage.
bool ret = set_properties (p, f);
}
rxvt_font () { name = 0; }
- ~rxvt_font () { clear (); free (name); };
+ ~rxvt_font () { free (name); };
void clear_rect (int x, int y, int w, int h, int color);
int fg, int bg) = 0;
};
-//#define FONT_REF(obj) (obj)->refcnt++
-//#define FONT_UNREF(obj) if (!--(obj)->refcnt) delete (obj)
-#define FONT_UNREF(f) delete f
+#define FONT_UNREF(f) do { (f)->clear (); delete (f); } while (0)
struct rxvt_fallback_font;
* @ COLORTERM: terminal sub-name and also indicates its color
* @ TERM: terminal name
* @ TERMINFO: path to terminfo directory
+ * @ COLORFGBG: fg;bg color codes
*/
putenv (env_display);
putenv (env_windowid);
+ if (env_colorfgbg)
+ putenv (env_colorfgbg);
#ifdef RXVT_TERMINFO
putenv ("TERMINFO=" RXVT_TERMINFO);
case 0:
close (cfd); /* only keep tty_fd and STDERR open */
+ init_env ();
+
if (rxvt_control_tty (tty_fd, ttydev) < 0)
rxvt_print_error ("could not obtain control of tty");
else
scr_release ();
+ free (env_windowid);
+ free (env_display);
+ free (env_term);
+ free (env_colorfgbg);
free (locale);
free (codeset);
delete TermWin.fontset;
displays.put (display);
+
+ delete envv;
+ delete argv;
}
void
XMapWindow (display->display, TermWin.vt);
XMapWindow (display->display, TermWin.parent[0]);
- init_env ();
init_command (cmd_argv);
pty_ev.start (cmd_fd, EVENT_READ);
#endif
break;
}
+
sprintf (env_colorfgbg, "COLORFGBG=%s;%s%s", fstr, xpmb, bstr);
- putenv (env_colorfgbg);
#ifndef NO_BRIGHTCOLOR
colorfgbg = DEFAULT_RSTYLE;
unsigned char *v_buffer; /* pointer to physical buffer */
unsigned int v_buflen; /* size of area to write */
char *newfont[MAX_NFONTS];
+ stringvec *argv, *envv; /* if != 0, will be freed on destroy time */
#ifdef KEYSYM_RESOURCE
const unsigned char *Keysym_map[256];
#endif
-#include "rxvtlib.h"
+#include "../config.h"
+#include "rxvt.h"
#include "rxvtdaemon.h"
#include "iom.h"
{
if (!strcmp (tok, "NEW"))
{
- stringvec argv;
- stringvec envv;
+ stringvec *argv = new stringvec;
+ stringvec *envv = new stringvec;
for (;;)
{
if (!strcmp (tok, "END"))
break;
else if (!strcmp (tok, "ENV") && recv (tok))
- envv.push_back (tok.get ());
+ envv->push_back (tok.get ());
else if (!strcmp (tok, "CWD") && recv (tok))
{
if (chdir (tok))
(char *)tok, strerror (errno));
}
else if (!strcmp (tok, "ARG") && recv (tok))
- argv.push_back (tok.get ());
+ argv->push_back (tok.get ());
else
return err ("protocol error: unexpected NEW token");
}
- envv.push_back (0);
+ envv->push_back (0);
{
char **old_environ = environ;
- environ = envv.begin ();
+ environ = envv->begin ();
- rxvt_init (argv.size (), argv.begin ());
+ rxvt_term *term = rxvt_init (argv->size (), argv->begin ());
+
+ term->argv = argv;
+ term->envv = envv;
environ = old_environ;
- envv.clear (); // can't yet save the env 'cause rxvt modifies it : (
}
}
else