diff --git a/src/scheme/debug.rs b/src/scheme/debug.rs index e5ff0e0286..b5f965c40f 100644 --- a/src/scheme/debug.rs +++ b/src/scheme/debug.rs @@ -61,12 +61,7 @@ impl KernelScheme for DebugScheme { "no-preserve" => SpecialFds::NoPreserve as usize, - "disable-graphical-debug" => { - #[cfg(feature = "graphical_debug")] - graphical_debug::fini(); - - SpecialFds::DisableGraphicalDebug as usize - } + "disable-graphical-debug" => SpecialFds::DisableGraphicalDebug as usize, #[cfg(feature = "profiling")] p if p.starts_with("profiling-") => { @@ -165,6 +160,13 @@ impl KernelScheme for DebugScheme { return Ok(1); } + if handle.num == SpecialFds::DisableGraphicalDebug as usize { + #[cfg(feature = "graphical_debug")] + graphical_debug::fini(); + + return Ok(0); + } + if handle.num != SpecialFds::Default as usize && handle.num != SpecialFds::NoPreserve as usize {