소스 검색

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!
Aleos 2 년 전
부모
커밋
5e6fd03848
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      src/common/database.hpp

+ 1 - 0
src/common/database.hpp

@@ -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{