-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add back Console::drop #17
Conversation
This is needed for soundness. Otherwise libctru will have a dangling pointer, and will write to it when printing.
Just to be on the same page, my main is:
|
If the default console isn't initialized then it will segfault.
I guess I had the misconception that the initial selected console value is the default console. It's actually a zeroed-out console: (I was wondering if it would use uninitialized memory or zeroed memory, and found this: https://stackoverflow.com/questions/4080673/are-the-members-of-a-global-structure-initialized-to-zero-by-default-in-c) So I'll change it to set the console to some zeroed out console on drop, if it was the selected console. |
Unfortunately right now So I used the recommended workaround: |
It's no longer simpler, but at least it's safe. |
Nice, not printing once the Console is dropped is both expected behaviour and easy to use. |
This is needed for soundness. Otherwise libctru will have a dangling pointer and will write to it when printing.
Closes #15 (I think, maybe we also need some panic changes before closing?)