mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-10 04:51:17 +00:00
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:
@@ -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)
|
||||
|
Reference in New Issue
Block a user