mirror of
https://github.com/nlohmann/json.git
synced 2025-07-28 12:02:00 +03:00
Fixes #1971 (memory leak in basic_json::push_back)
This commit is contained in:
@ -19421,9 +19421,7 @@ class basic_json
|
||||
|
||||
// add element to array (move semantics)
|
||||
m_value.array->push_back(std::move(val));
|
||||
// invalidate object: mark it null so we do not call the destructor
|
||||
// cppcheck-suppress accessMoved
|
||||
val.m_type = value_t::null;
|
||||
// if val is moved from, basic_json move constructor marks it null so we do not call the destructor
|
||||
}
|
||||
|
||||
/*!
|
||||
|
Reference in New Issue
Block a user