From f6da0164582155fc1711192d263fabbf2dc524dc Mon Sep 17 00:00:00 2001 From: MTRNord Date: Mon, 26 Jul 2021 22:59:31 +0200 Subject: [PATCH] Drop in the same way as https://github.com/gphoto/libgphoto2/blob/84eb49d0f8c4adb15a9651d01425de67bf95f811/examples/sample-autodetect.c --- src/camera.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/camera.rs b/src/camera.rs index c9777e4..32aae32 100644 --- a/src/camera.rs +++ b/src/camera.rs @@ -19,7 +19,8 @@ pub struct Camera { impl Drop for Camera { fn drop(&mut self) { unsafe { - crate::gphoto2::gp_camera_unref(self.camera); + crate::gphoto2::gp_camera_exit(self.camera, self.context.context); + crate::gphoto2::gp_camera_free(self.camera); crate::gphoto2::gp_context_unref(self.context.context); } }