Skip to content

Commit 5ca84bb

Browse files
committed
Add keepalive for snapshots api
1 parent 6879d02 commit 5ca84bb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/binding/python/Series.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,8 @@ not possible once it has been closed.
301301
throw std::runtime_error("Unreachable");
302302
},
303303
// copy + keepalive
304-
py::return_value_policy::copy)
304+
py::return_value_policy::copy,
305+
py::keep_alive<0, 1>())
305306
.def(
306307
"current_iteration",
307308
[](Snapshots &s) -> std::optional<IndexedIteration> {
@@ -315,6 +316,7 @@ not possible once it has been closed.
315316
return std::nullopt;
316317
}
317318
},
319+
py::keep_alive<0, 1>(),
318320
"Return the iteration that is currently being written to, if "
319321
"it "
320322
"exists.");

0 commit comments

Comments
 (0)