]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
PyModule: Fix memory leak in load 62197/head
authorNitzan Mordechai <nmordech@redhat.com>
Sun, 9 Feb 2025 07:14:55 +0000 (07:14 +0000)
committerNitzan Mordechai <nmordech@redhat.com>
Wed, 7 May 2025 11:38:19 +0000 (11:38 +0000)
PyModule: Interpreter never ended - leaks

Need to ending the interpreter to prevent valgrind leaks

Signed-off-by: Nitzan Mordechai <nmordech@redhat.com>
src/mgr/PyModule.cc

index e4b70956299094c88e577a2586f6f7c99c9315ed..fe33555280e149d82b8194b6127f5081a856a2d2 100644 (file)
@@ -708,6 +708,8 @@ PyModule::~PyModule()
     Gil gil(pMyThreadState, true);
     Py_XDECREF(pClass);
     Py_XDECREF(pStandbyClass);
+    Py_EndInterpreter(pMyThreadState.ts);
+    pMyThreadState.ts = nullptr;
   }
 }