diff --git a/cpp/runtime/state/rocksdb/RocksdbMapStateTable.h b/cpp/runtime/state/rocksdb/RocksdbMapStateTable.h index 9697338d1f14e97b67654538316f56e95ae259c0..c4b152bf0690391225e4eb899310c21cf2a74237 100644 --- a/cpp/runtime/state/rocksdb/RocksdbMapStateTable.h +++ b/cpp/runtime/state/rocksdb/RocksdbMapStateTable.h @@ -121,7 +121,11 @@ public: if constexpr (std::is_pointer_v) { return (UV)resPtr; } else { - return *(UV *)resPtr; // attention: need to delete restPtr in the caller after using + UV value = *(UV*)resPtr; + delete (UV*)resPtr; + return value; + + // return *(UV *)resPtr; // attention: need to delete restPtr in the caller after using } } }; @@ -881,4 +885,4 @@ std::vector> *RocksdbMapStateTable::getKeysAndNam return nullptr; } -#endif // OMNISTREAM_ROCKSDBMAPSTATETABLE_H \ No newline at end of file +#endif // OMNISTREAM_ROCKSDBMAPSTATETABLE_H