From 855456a9d98c5c27bb2b00bab4018630598117fa Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 19 Jun 2009 03:11:33 +0000 Subject: Primitive garbage collector for AST nodes. Fix memory leaks. git-svn-id: http://svn.drobilla.net/resp/tuplr@123 ad02d1e2-f140-0410-9f75-f8b11f17cedd --- tuplr.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tuplr.cpp') diff --git a/tuplr.cpp b/tuplr.cpp index 10233f9..6321a5c 100644 --- a/tuplr.cpp +++ b/tuplr.cpp @@ -27,6 +27,7 @@ using namespace std; using boost::format; Funcs AConsCall::funcs; +GC AST::pool; template ostream& @@ -228,6 +229,7 @@ initLang(PEnv& penv, TEnv& tenv) } + /*************************************************************************** * EVAL/REPL/MAIN * ***************************************************************************/ @@ -256,6 +258,7 @@ main(int argc, char** argv) CEnv* cenv = newCenv(penv, tenv); cenv->push(); + AST::pool.lock(); map args; list files; @@ -326,7 +329,7 @@ main(int argc, char** argv) os.close(); } - delete cenv; + freeCenv(cenv); return ret; } -- cgit v1.2.1