Author: greenlizard Date: Fri Jan 16 00:03:51 2009 New Revision: 11254 Log: Fix contributed by Stas Shtin to stop a resource leak, see MODLANG-95 Modified: freeswitch/trunk/src/mod/languages/mod_python/mod_python.c Modified: freeswitch/trunk/src/mod/languages/mod_python/mod_python.c ============================================================================== --- freeswitch/trunk/src/mod/languages/mod_python/mod_python.c (original) +++ freeswitch/trunk/src/mod/languages/mod_python/mod_python.c Fri Jan 16 00:03:51 2009 @@ -198,7 +198,10 @@ } if (tstate) { + // thread state must be cleared explicitly or we'll get memory leaks + PyThreadState_Clear(tstate); PyEval_ReleaseThread(tstate); + PyThreadState_Delete(tstate); } done: