From 6e5dc7f74ee802016fd66345316588fd097642ed Mon Sep 17 00:00:00 2001 From: Parshikov Mikhail Date: Sun, 5 May 2024 16:45:45 +0300 Subject: [PATCH] Fixing memory leakage when using dlpack --- src/python/library/tritonclient/utils/_dlpack.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/python/library/tritonclient/utils/_dlpack.py b/src/python/library/tritonclient/utils/_dlpack.py index 94d3dfe5f..94efa6552 100644 --- a/src/python/library/tritonclient/utils/_dlpack.py +++ b/src/python/library/tritonclient/utils/_dlpack.py @@ -140,7 +140,6 @@ def as_manager_ctx(self) -> ctypes.c_void_p: py_obj = ctypes.py_object(self) py_obj_ptr = ctypes.pointer(py_obj) ctypes.pythonapi.Py_IncRef(py_obj) - ctypes.pythonapi.Py_IncRef(ctypes.py_object(py_obj_ptr)) return ctypes.cast(py_obj_ptr, ctypes.c_void_p)