We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a5fd15a commit bae3baeCopy full SHA for bae3bae
src/runtime/loader.cs
@@ -1,3 +1,4 @@
1
+using System.Diagnostics;
2
using System;
3
using System.Runtime.InteropServices;
4
using System.Text;
@@ -49,13 +50,18 @@ public unsafe static int Initialize(IntPtr data, int size)
49
50
return 0;
51
}
52
- public static int Shutdown(IntPtr data, int size)
53
+ public unsafe static int Shutdown(IntPtr data, int size)
54
{
55
IntPtr gs = IntPtr.Zero;
56
try
57
- gs = PyGILState_Ensure();
58
- PythonEngine.Shutdown();
+ var command = Encoding.UTF8.GetString((byte*)data.ToPointer(), size);
59
+
60
+ if (command == "full_shutdown")
61
+ {
62
+ gs = PyGILState_Ensure();
63
+ PythonEngine.Shutdown();
64
+ }
65
66
catch (Exception exc)
67
0 commit comments