fix: Corrected some memory leaks

This commit is contained in:
WerWolv
2023-06-11 10:47:17 +02:00
parent ee57c449e7
commit 34732a1ee7
5 changed files with 16 additions and 15 deletions

View File

@@ -774,14 +774,14 @@ namespace hex {
namespace impl {
std::vector<Hash *> &getHashes() {
static std::vector<Hash *> hashes;
std::vector<std::unique_ptr<Hash>> &getHashes() {
static std::vector<std::unique_ptr<Hash>> hashes;
return hashes;
}
void add(Hash *hash) {
getHashes().push_back(hash);
void add(std::unique_ptr<Hash> &&hash) {
getHashes().emplace_back(std::move(hash));
}
}