From d6d071d6fda8605901d70ac12e1f93ee3180d148 Mon Sep 17 00:00:00 2001 From: churl Date: Mon, 23 May 2022 11:52:38 +0200 Subject: [PATCH] update --- .gitignore | 0 c_os/devices/BufferedCGA.cc | 2 +- c_os/lib/ScrollbackBuffer.h | 3 ++- 3 files changed, 3 insertions(+), 2 deletions(-) mode change 100755 => 100644 .gitignore diff --git a/.gitignore b/.gitignore old mode 100755 new mode 100644 diff --git a/c_os/devices/BufferedCGA.cc b/c_os/devices/BufferedCGA.cc index 7e0a5d5..473d230 100755 --- a/c_os/devices/BufferedCGA.cc +++ b/c_os/devices/BufferedCGA.cc @@ -3,7 +3,7 @@ // Can't initialize in constructor as memory management already needs working CGA for output // NOTE: This has to be called when memorymanagement is active void BufferedCGA::init(unsigned int pages) { - this->scrollback_buffer = new ScrollbackBuffer(ROWS, pages); + this->scrollback_buffer = new ScrollbackBuffer(ROWS, pages); // No delete since it's only off when shutting the os down this->screen_buffer = new CGA::cga_page_t; if (this->scrollback_buffer == NULL || this->screen_buffer == NULL) { diff --git a/c_os/lib/ScrollbackBuffer.h b/c_os/lib/ScrollbackBuffer.h index d60d462..523da23 100755 --- a/c_os/lib/ScrollbackBuffer.h +++ b/c_os/lib/ScrollbackBuffer.h @@ -20,9 +20,10 @@ public: ScrollbackBuffer(unsigned char rows, unsigned char pages) : pos(0), pages(pages), rows(rows * pages) { - this->buffer = new CGA::cga_page_t[pages]; // Allocate with new because it's quite large + this->buffer = new CGA::cga_page_t[pages]; // Allocate with new because it's quite large (and I want to use the allocator) this->clear(); // Null out the buffer so no crap gets displayed } + ~ScrollbackBuffer() { delete[] this->buffer; }