This commit is contained in:
MihailRis
2024-04-28 22:33:34 +03:00
parent 167388aefb
commit ef28a368cb
12 changed files with 54 additions and 51 deletions
+3 -1
View File
@@ -26,7 +26,9 @@ std::shared_ptr<Inventory> Inventories::createVirtual(size_t size) {
auto inv = std::make_shared<Inventory>(id, size);
store(inv);
return inv;
return std::shared_ptr<Inventory>(inv.get(), [this](Inventory* ptr) {
remove(ptr->getId());
});
}
void Inventories::store(std::shared_ptr<Inventory> inv) {