diff --git a/gui.cpp b/gui.cpp index 6730d04..733613f 100644 --- a/gui.cpp +++ b/gui.cpp @@ -117,6 +117,26 @@ Gui::~Gui() if (VirtualKeyboard::kbd) delete VirtualKeyboard::kbd; + + SDL_FreeSurface(this->bg_left); + SDL_FreeSurface(this->bg_middle); + SDL_FreeSurface(this->bg_right); + SDL_FreeSurface(this->bg_submenu_left); + SDL_FreeSurface(this->bg_submenu_middle); + SDL_FreeSurface(this->bg_submenu_right); + SDL_FreeSurface(this->background); + SDL_FreeSurface(this->main_menu_bg); + SDL_FreeSurface(this->infobox); + SDL_FreeSurface(this->dialogue_bg); + SDL_FreeSurface(this->disc_info); + SDL_FreeSurface(this->textbox); + SDL_FreeSurface(this->selected_key); + SDL_FreeSurface(this->highlighted_key); + + if (this->default_font) + delete this->default_font; + if (this->small_font) + delete this->small_font; } bool Gui::setTheme(const char *path) diff --git a/main.cpp b/main.cpp index 93fbd0d..10b24eb 100644 --- a/main.cpp +++ b/main.cpp @@ -63,5 +63,7 @@ int main(int argc, char *argv[]) run(); fini(); + SDL_Quit(); + return 0; } diff --git a/sdl_ttf_font.hh b/sdl_ttf_font.hh index 7b21d1f..84fd843 100644 --- a/sdl_ttf_font.hh +++ b/sdl_ttf_font.hh @@ -19,7 +19,7 @@ public: ~Font_TTF() { - free(this->font); + TTF_CloseFont(this->font); } int getHeight(const char *str)