From fec2c61576a75b925111cdceeb6cf19ab1841dfe Mon Sep 17 00:00:00 2001 From: Extrems Date: Sun, 17 Nov 2024 21:30:48 -0500 Subject: [PATCH] Avoid cross-deinitialization --- libogc/console.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libogc/console.c b/libogc/console.c index 7cb0cc9..4dc24e4 100644 --- a/libogc/console.c +++ b/libogc/console.c @@ -669,6 +669,7 @@ static int __gecko_close(void *c) void CON_EnableGecko(s32 chan,bool safe) { + if(chan<0 && __gecko_chan==-1) return; if(chan>=0 && (__gecko_chan==chan || !usb_isgeckoalive(chan))) return; fclose(stdcon); @@ -706,6 +707,8 @@ static int __uart_write(void *c,const char *buf,int n) void CON_EnableBarnacle(s32 chan,s32 dev) { + if(chan<0 && __gecko_chan>=0) return; + fclose(stdcon); stdcon = NULL;