Fixed another blatant memory leak.

This commit is contained in:
Sergey Popov 2011-09-09 11:35:43 +00:00
parent f1eda25fd4
commit 164d927c59

View file

@ -80,9 +80,9 @@ public:
/// Do not inline this enforces static initialization order
template <char T_defval>
t_token const & t_token::default_value() {
static t_token *z_defval = new t_token(std::string(1, T_defval), false);
return *z_defval;
const t_token& t_token::default_value() {
static t_token z_defval(std::string(1, T_defval), false);
return z_defval;
}
inline std::string operator+(const n_token::t_token &a, const std::string &b) { return static_cast<std::string const &>(a) + b; }