From: Nitzan Mordechai Date: Sun, 9 Feb 2025 07:14:55 +0000 (+0000) Subject: PyModule: Fix memory leak in load X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3366ef5153f3af8fa4d83dfc40a4a4a4fad7557d;p=ceph.git PyModule: Fix memory leak in load PyModule: Interpreter never ended - leaks Need to ending the interpreter to prevent valgrind leaks Signed-off-by: Nitzan Mordechai --- diff --git a/src/mgr/PyModule.cc b/src/mgr/PyModule.cc index e4b7095629909..fe33555280e14 100644 --- a/src/mgr/PyModule.cc +++ b/src/mgr/PyModule.cc @@ -708,6 +708,8 @@ PyModule::~PyModule() Gil gil(pMyThreadState, true); Py_XDECREF(pClass); Py_XDECREF(pStandbyClass); + Py_EndInterpreter(pMyThreadState.ts); + pMyThreadState.ts = nullptr; } }