First pass memory tool

This commit is contained in:
2023-10-10 08:55:50 -05:00
parent 2423fd9f70
commit 9ad9995663
11 changed files with 183 additions and 99 deletions

View File

@ -155,12 +155,22 @@ int32_t DawnHost::update(DawnGame *game, float_t delta) {
}
void DawnHost::unload(DawnGame *game) {
glfwDestroyWindow(this->data->window);
this->data->window = nullptr;
glfwTerminate();
assertNotNull(game, "DawnHost::unload: game must not be null");
assertNotNull(this->data, "DawnHost::unload: data must not be null");
if(this->data->window != nullptr) {
glfwDestroyWindow(this->data->window);
this->data->window = nullptr;
glfwTerminate();
}
}
DawnHost::~DawnHost() {
assertNotNull(this->data, "DawnHost::~DawnHost: data must not be null");
if(this->data->window != nullptr) {
glfwDestroyWindow(this->data->window);
this->data->window = nullptr;
glfwTerminate();
}
delete this->data;
DAWN_HOST = nullptr;
}