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;
|
Runtime.PythonDLL = pyLoc;
|
||||||
PythonEngine.Initialize();
|
PythonEngine.Initialize();
|
||||||
#if DEBUG
|
|
||||||
_pyState = PythonEngine.BeginAllowThreads();
|
_pyState = PythonEngine.BeginAllowThreads();
|
||||||
#endif
|
|
||||||
|
|
||||||
lifetime.ApplicationStopping.Register(() => {
|
lifetime.ApplicationStopping.Register(() => {
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
#if DEBUG
|
|
||||||
PythonEngine.EndAllowThreads(_pyState);
|
PythonEngine.EndAllowThreads(_pyState);
|
||||||
#endif
|
|
||||||
PythonEngine.Shutdown();
|
PythonEngine.Shutdown();
|
||||||
}
|
}
|
||||||
catch { }
|
catch { }
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue