Use std::string instead of const char* for GetKey function

This commit is contained in:
Rahul Sheth 2020-07-10 14:27:37 -04:00
parent 6cd8fdb2c8
commit 01d54380ac

View File

@ -3000,7 +3000,9 @@ json_const_iterator ObjectEnd(const json &o) {
#endif
}
const char *GetKey(json_const_iterator &it) {
// Making this a const char* results in a pointer to a temporary when
// TINYGLTF_USE_RAPIDJSON is off.
std::string GetKey(json_const_iterator &it) {
#ifdef TINYGLTF_USE_RAPIDJSON
return it->name.GetString();
#else