]> granicus.if.org Git - re2c/commitdiff
- Fix memleaks (State::action)
authorhelly <helly@642ea486-5414-0410-9d7f-a0204ed87703>
Mon, 5 Jun 2006 22:12:05 +0000 (22:12 +0000)
committerhelly <helly@642ea486-5414-0410-9d7f-a0204ed87703>
Mon, 5 Jun 2006 22:12:05 +0000 (22:12 +0000)
re2c/code.cc
re2c/dfa.cc

index 75c1ad6f4337000f330472e224456172a3f742b2..784b33ebc0967beed2bd3bb49486469acbd2d3fe 100644 (file)
@@ -1407,6 +1407,7 @@ void DFA::emit(std::ostream &o, uint ind)
                                if (s->go.span[i].to && !s->go.span[i].to->rule)
                                {
                                        delete s->action;
+                                       s->action = NULL;
 
                                        if (saves[s->rule->accept] == ~0u)
                                        {
@@ -1500,6 +1501,7 @@ void DFA::emit(std::ostream &o, uint ind)
        findBaseState();
 
        delete head->action;
+       head->action = NULL;
 
        if (bFlag)
        {
index 2d3779f48a1ef3d049bc9e757a1d63a33449a3f3..dcd6ff6a95d1f5bb3a79ea208b9ac20de670f050 100644 (file)
@@ -189,6 +189,7 @@ State::State()
 
 State::~State()
 {
+       delete action;
        delete [] kernel;
        delete [] go.span;
 }