Fixes a potential crash with database reloading (#7061)

* Fixes #7060.
* The cached YAML content will now properly reallocate the memory when the clear command is called.
Thanks to eppc0330!
This commit is contained in:
Aleos 2022-06-24 15:43:45 -04:00 committed by GitHub
parent d173755afc
commit 5e6fd03848
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -156,6 +156,7 @@ public:
void clear() override{
TypesafeYamlDatabase<keytype, datatype>::clear();
cache.clear();
cache.shrink_to_fit();
}
std::shared_ptr<datatype> find( keytype key ) override{