]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Fix contributed by Stas Shtin to stop a resource leak, see MODLANG-95
authorTraun Leyden <tleyden@branchcut.com>
Fri, 16 Jan 2009 06:03:51 +0000 (06:03 +0000)
committerTraun Leyden <tleyden@branchcut.com>
Fri, 16 Jan 2009 06:03:51 +0000 (06:03 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11254 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/languages/mod_python/mod_python.c

index 1c5b1c05d6c69107d437816cf27eb189afb15937..1853ceb773ca388e1863df1a54c86c36f2afa21d 100644 (file)
@@ -198,7 +198,10 @@ static void eval_some_python(const char *funcname, char *args, switch_core_sessi
        }
        
        if (tstate) {
+               // thread state must be cleared explicitly or we'll get memory leaks
+               PyThreadState_Clear(tstate);
                PyEval_ReleaseThread(tstate);
+               PyThreadState_Delete(tstate);
        }
        
  done: