Merge pull request #1178 from iceljc/features/refine-py-interpreter
Features/refine py interpreter
This commit is contained in:
commit
a75c0a097f
|
|
@ -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 { }
|
||||
|
|
|
|||
Loading…
Reference in a new issue