Prevent dangling pointer

This commit is contained in:
Alex
2023-03-14 06:24:02 +02:00
parent 855384aead
commit d7c9b7ab02
23 changed files with 91 additions and 90 deletions

View File

@ -74,8 +74,9 @@ namespace Video
if (this->Buffers[Index] == nullptr)
return;
KernelAllocator.FreePages(this->Buffers[Index]->Buffer, TO_PAGES(this->Buffers[Index]->Size));
this->Buffers[Index]->Buffer = nullptr;
this->Buffers[Index]->Checksum = 0; // Making sure that the buffer is not used anymore
delete this->Buffers[Index];
delete this->Buffers[Index], this->Buffers[Index] = nullptr;
}
void Display::SetBufferCursor(int Index, uint32_t X, uint32_t Y)