Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

Commit

Permalink
Shutdown fix built into PythonEngine.Shutdown()
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanov committed Oct 14, 2016
1 parent 74636e7 commit 2691ce0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
12 changes: 0 additions & 12 deletions src/Python.Bootstrapper.Test/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,6 @@ static int Main(string[] args)
Console.WriteLine("Python engine version:");
Console.WriteLine(sysModule.version);
}

// This workaround reduces risk of Mono crash.
// Problem will be fixed in mono 4.6
if (Path.DirectorySeparatorChar == '/' || Type.GetType("Mono.Runtime") != null)
{
Runtime.Py_Main(3, new[] { "/pcfgtest.exe", "-c", "exit" });
}
else
{
// Program will crash if we will try to do this under Windows.
//// Runtime.Py_Main(3, new[] { "/pcfgtest.exe", "-c", "exit" });
}
}
finally
{
Expand Down
15 changes: 14 additions & 1 deletion src/runtime/runtime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,20 @@ internal static void Initialize()
}

internal static void Shutdown()
{
{
// This workaround reduces risk of Mono or Linux crash.
// Problem probably will be fixed in mono 4.6
if (Path.DirectorySeparatorChar == '/' || Type.GetType("Mono.Runtime") != null)
{
Runtime.Py_Main(3, new[] { "/some.exe", "-c", "exit" });
}
else
{
// else
// Program will crash if we will try to do this under Windows.
//// Runtime.Py_Main(3, new[] { "/some.exe", "-c", "exit" });
}

AssemblyManager.Shutdown();
Exceptions.Shutdown();
ImportHook.Shutdown();
Expand Down

0 comments on commit 2691ce0

Please sign in to comment.