From 663cd833e391d607c450b6d7dd69469d062545b7 Mon Sep 17 00:00:00 2001 From: Emanuele Giaquinta Date: Sun, 17 Nov 2024 21:48:36 +0200 Subject: [PATCH] Fix object release Signed-off-by: Emanuele Giaquinta --- src/serialize/serializer.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/serialize/serializer.rs b/src/serialize/serializer.rs index 257f2e87..e70e44ec 100644 --- a/src/serialize/serializer.rs +++ b/src/serialize/serializer.rs @@ -34,7 +34,7 @@ pub fn serialize( match res { Ok(_) => Ok(buf.finish()), Err(err) => { - ffi!(_Py_Dealloc(buf.finish().as_ptr())); + ffi!(Py_DECREF(buf.finish().as_ptr())); Err(err.to_string()) } }