From 9cf989c61b992c2b759b8ba338f2234854aea201 Mon Sep 17 00:00:00 2001 From: Coldwings Date: Thu, 8 Aug 2024 13:53:39 +0800 Subject: [PATCH] Fix on operation update --- common/objectcachev2.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/objectcachev2.h b/common/objectcachev2.h index 4c3bcbcd..6c1886ed 100644 --- a/common/objectcachev2.h +++ b/common/objectcachev2.h @@ -232,11 +232,11 @@ class ObjectCacheV2 { template Borrow update(KeyType&& key, Ctor&& ctor) { - auto box = __find_or_create_box(std::forward(key)); + auto& box = __find_or_create_box(std::forward(key)); DEFER(box.release()); - auto r = ctor(); + auto r = std::shared_ptr(ctor()); box.update(r, photon::now); - return Borrow(this, box, r); + return Borrow(this, &box, r); } ObjectCacheV2(uint64_t lifespan)