Replaced the queue of Token pointers with values.

We were getting memory leaks (as told by the CRT detectors, which I also added), and there's really no reason (as long as we're careful) to use pointers there.
This commit is contained in:
Jesse Beder
2008-07-20 05:02:01 +00:00
parent 2eab1e025e
commit 09d7ab365f
25 changed files with 297 additions and 251 deletions

View File

@@ -1,3 +1,4 @@
#include "crt.h"
#include "scanner.h"
#include "token.h"
#include "exceptions.h"
@@ -39,9 +40,9 @@ namespace YAML
key.pMapStart->status = TS_UNVERIFIED;
// then add the (now unverified) key
key.pKey = new Token(TT_KEY, INPUT.line, INPUT.column);
m_tokens.push(Token(TT_KEY, INPUT.line, INPUT.column));
key.pKey = &m_tokens.back();
key.pKey->status = TS_UNVERIFIED;
m_tokens.push(key.pKey);
m_simpleKeys.push(key);
}