From 2e11498943153e72afe0af0f64aecf090c0df659 Mon Sep 17 00:00:00 2001 From: Rodion Malinovsky Date: Wed, 16 Sep 2015 14:54:38 +0300 Subject: [PATCH] Fix the usage of the stack::GetAllocator --- include/rapidjson/document.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h index 6275f96..0a5a7b2 100644 --- a/include/rapidjson/document.h +++ b/include/rapidjson/document.h @@ -1887,7 +1887,8 @@ public: template GenericDocument& ParseStream(InputStream& is) { ValueType::SetNull(); // Remove existing root if exist - GenericReader reader(&stack_.GetAllocator()); + GenericReader reader( + stack_.HasAllocator() ? &stack_.GetAllocator() : 0); ClearStackOnExit scope(*this); parseResult_ = reader.template Parse(is, *this); if (parseResult_) {