Esempio n. 1
0
        /// <summary>
        /// Cleanup resources upon shutdown of the Python runtime.
        /// </summary>
        internal static void Shutdown()
        {
            if (Runtime.Py_IsInitialized() != 0)
            {
                Runtime.XDecref(py_clr_module);
                py_clr_module = IntPtr.Zero;

                Runtime.XDecref(root.pyHandle);
                root = null;

                hook.Dispose();
                hook = null;

                Runtime.XDecref(py_import);
                py_import = IntPtr.Zero;

                CLRModule.ResetFlags();
            }
        }