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 "scalar.h"
#include "scanner.h"
#include "token.h"
@@ -16,9 +17,9 @@ namespace YAML
void Scalar::Parse(Scanner *pScanner, const ParserState& state)
{
Token *pToken = pScanner->GetNextToken();
m_data = pToken->value;
delete pToken;
Token& token = pScanner->PeekToken();
m_data = token.value;
pScanner->PopToken();
}
void Scalar::Write(std::ostream& out, int indent, bool startedLine, bool onlyOneCharOnLine)