diff --git a/freenect2/__init__.py b/freenect2/__init__.py index 9946613..bb5a1de 100644 --- a/freenect2/__init__.py +++ b/freenect2/__init__.py @@ -346,7 +346,8 @@ def create(self, width, height, bytes_per_pixel): attributes are initialised. """ - return Frame(lib.freenect2_frame_create(width, height, bytes_per_pixel)) + frame_ref = lib.freenect2_frame_create(width, height, bytes_per_pixel) + return Frame(ffi.gc(frame_ref, lib.freenect2_frame_dispose)) def to_image(self): """Convert the Frame to a PIL :py:class:`Image` instance."""