Fix some texture leaks on game exit

This commit is contained in:
UnknownShadow200 2018-11-26 21:06:41 +11:00
parent b11d5185e8
commit b2a6fd87ec
2 changed files with 3 additions and 0 deletions

View File

@ -55,7 +55,9 @@ namespace ClassicalSharp {
void IDisposable.Dispose() {
Events.TextureChanged -= TextureChanged;
SetNewScreen(null);
statusScreen.Dispose();
hudScreen.Dispose();
if (activeScreen != null)
activeScreen.Dispose();

View File

@ -110,6 +110,7 @@ static void Gui_Free(void) {
Event_UnregisterEntry(&TextureEvents_FileChanged, NULL, Gui_FileChanged);
Gui_CloseActive();
Elem_TryFree(Gui_Status);
Elem_TryFree(Gui_HUD);
if (Gui_Active) { Elem_TryFree(Gui_Active); }
Gfx_DeleteTexture(&Gui_GuiTex);