diff --git a/lib/tests/jsonreflector.cpp b/lib/tests/jsonreflector.cpp index 2671de6..47170fe 100644 --- a/lib/tests/jsonreflector.cpp +++ b/lib/tests/jsonreflector.cpp @@ -182,7 +182,8 @@ void JsonReflectorTests::testSerializePrimitives() Document::Array array(doc.GetArray()); // string - Reflector::push("foo"s, array, alloc); + const string foo("foo"); // musn't be destroyed until JSON is actually written + Reflector::push(foo, array, alloc); Reflector::push("bar", array, alloc); // number Reflector::push(25, array, alloc);