fixed several memory leaks caused by not including virtual destructors, added a config for the visualizer, next up is lua

This commit is contained in:
2021-12-22 12:33:47 -05:00
parent 00abbbebbd
commit 1a917af13c
23 changed files with 272 additions and 64 deletions

View File

@@ -55,6 +55,10 @@ void SdlRenderer::draw_text(std::optional<TextRenderDetails> details, std::strin
}
SdlRenderer::~SdlRenderer() {
// clear resource managers pointing to shared pointers
// This avoids an invalid read, since otherwise TTF_Quit will cleanup fonts and then clearing the shared pointers will try it again
font_manager->clear_all_resources();
texture_manager->clear_all_resources();
// exit subsystems
IMG_Quit();
TTF_Quit();