From c14c0ac02f67360caf77376915ccad4d7fc44dfa Mon Sep 17 00:00:00 2001 From: Hector Martin Date: Fri, 26 Feb 2016 19:05:24 +0900 Subject: [PATCH] pybind/rbd: keep a ref to the Image in SnapIterator Signed-off-by: Hector Martin --- src/pybind/rbd/rbd.pyx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pybind/rbd/rbd.pyx b/src/pybind/rbd/rbd.pyx index 92a708bd30832..e87faa5125b1b 100644 --- a/src/pybind/rbd/rbd.pyx +++ b/src/pybind/rbd/rbd.pyx @@ -1942,8 +1942,10 @@ cdef class SnapIterator(object): cdef rbd_snap_info_t *snaps cdef int num_snaps + cdef object image def __init__(self, Image image): + self.image = image self.snaps = NULL self.num_snaps = 10 while True: -- 2.39.5