Python.Runtime.Exceptions.Shutdown C# (CSharp) Method

Shutdown() static private method

static private Shutdown ( ) : void
return void
        internal static void Shutdown()
        {
            if (0 != Runtime.Py_IsInitialized())
            {
                Type type = typeof(Exceptions);
                foreach (FieldInfo fi in type.GetFields(BindingFlags.Public |
                                                        BindingFlags.Static))
                {
                    IntPtr op = (IntPtr)fi.GetValue(type);
                    if (op != IntPtr.Zero)
                    {
                        Runtime.XDecref(op);
                    }
                }
                Runtime.XDecref(exceptions_module);
                Runtime.PyObject_HasAttrString(warnings_module, "xx");
                Runtime.XDecref(warnings_module);
            }
        }

Usage Example

Example #1
0
 internal static void Shutdown()
 {
     AssemblyManager.Shutdown();
     Exceptions.Shutdown();
     ImportHook.Shutdown();
     Interop.Py_Finalize();
 }