Browse Source

Add back initialization of default console in Console::drop

If the default console isn't initialized then it will segfault.
pull/17/head
AzureMarker 3 years ago
parent
commit
9a45f575c8
No known key found for this signature in database
GPG Key ID: 47A133F3BF9D03D3
  1. 5
      ctru-rs/src/console.rs

5
ctru-rs/src/console.rs

@ -65,7 +65,10 @@ impl Drop for Console { @@ -65,7 +65,10 @@ impl Drop for Console {
if std::ptr::eq(current_console, &*self.context) {
// Console dropped while selected. We just replaced it with the
// default so there's nothing more to do.
// default so make sure it's initialized.
if !(*default_console).consoleInitialised {
ctru_sys::consoleInit(Screen::Top.into(), default_console);
}
} else {
// Console dropped while a different console was selected. Put back
// the console that was selected.

Loading…
Cancel
Save