term: Fix deinitialisation issues

This commit is contained in:
mintsuki 2022-03-10 18:21:49 +01:00
parent 26acbb8bd9
commit 48eaab4a42
2 changed files with 6 additions and 2 deletions

View File

@ -25,7 +25,9 @@ void term_deinit(void) {
}
void term_vbe(size_t width, size_t height) {
term_notready();
if (term_backend != VBE) {
term_deinit();
}
if (quiet || allocations_disallowed) {
return;
@ -349,7 +351,7 @@ void term_reinit(void) {
#if bios == 1
void term_textmode(void) {
term_notready();
term_deinit();
if (quiet || allocations_disallowed) {
return;

View File

@ -594,6 +594,8 @@ failed_to_load_header_section:
fb = &_fb;
}
term_deinit();
if (hdrtag != NULL || (avtag != NULL && uefi) || (avtag != NULL && preference == 0)) {
term_deinit();