Example #1
0
        static void ReleaseConsole()
        {
            if (!hasConsole)
            {
                return;
            }

            if (shouldRedirectStdout)
            {
                Win32.CloseHandle(conOut);
            }
            if (!attachedConsole)
            {
                Win32.FreeConsole();
            }
            Win32.SetStdHandle(-11, oldOut);

            conOut     = IntPtr.Zero;
            hasConsole = false;
        }