aboutsummaryrefslogtreecommitdiffstats
path: root/tuplr.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-06-19 03:11:33 +0000
committerDavid Robillard <d@drobilla.net>2009-06-19 03:11:33 +0000
commit855456a9d98c5c27bb2b00bab4018630598117fa (patch)
tree8c13f757d5439558cba32eb0db050d76788b7a92 /tuplr.cpp
parent450137a8283cdc123b22a884d6af7fef2f3aae76 (diff)
downloadresp-855456a9d98c5c27bb2b00bab4018630598117fa.tar.gz
resp-855456a9d98c5c27bb2b00bab4018630598117fa.tar.bz2
resp-855456a9d98c5c27bb2b00bab4018630598117fa.zip
Primitive garbage collector for AST nodes.
Fix memory leaks. git-svn-id: http://svn.drobilla.net/resp/tuplr@123 ad02d1e2-f140-0410-9f75-f8b11f17cedd
Diffstat (limited to 'tuplr.cpp')
-rw-r--r--tuplr.cpp5
1 files changed, 4 insertions, 1 deletions
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<typename Atom>
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<string,string> args;
list<string> files;
@@ -326,7 +329,7 @@ main(int argc, char** argv)
os.close();
}
- delete cenv;
+ freeCenv(cenv);
return ret;
}