This commit is contained in:
Jicheng Lu 2025-10-08 16:02:23 -05:00
parent c20ab2e2e7
commit b34c989c44

View file

@ -39,16 +39,12 @@ public class PythonInterpreterPlugin : IBotSharpAppPlugin
{
Runtime.PythonDLL = pyLoc;
PythonEngine.Initialize();
#if DEBUG
_pyState = PythonEngine.BeginAllowThreads();
#endif
lifetime.ApplicationStopping.Register(() => {
try
{
#if DEBUG
PythonEngine.EndAllowThreads(_pyState);
#endif
PythonEngine.Shutdown();
}
catch { }