Fixed Issue 27 Default allocator is used for GenericReader in GenericDocument::ParseStream

git-svn-id: https://rapidjson.googlecode.com/svn/trunk@77 c5894555-1306-4e8d-425f-1f6f381ee07c
This commit is contained in:
miloyip@gmail.com 2012-11-14 02:53:04 +00:00
parent 9fb77b114b
commit 790b7f127c

View File

@ -705,7 +705,7 @@ public:
template <unsigned parseFlags, typename SourceEncoding, typename InputStream>
GenericDocument& ParseStream(InputStream& is) {
ValueType::SetNull(); // Remove existing root if exist
GenericReader<SourceEncoding, Encoding> reader;
GenericReader<SourceEncoding, Encoding, Allocator> reader;
if (reader.template Parse<parseFlags>(is, *this)) {
RAPIDJSON_ASSERT(stack_.GetSize() == sizeof(ValueType)); // Got one and only one root object
this->RawAssign(*stack_.template Pop<ValueType>(1)); // Add this-> to prevent issue 13.