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() { void IDisposable.Dispose() {
Events.TextureChanged -= TextureChanged; Events.TextureChanged -= TextureChanged;
SetNewScreen(null); SetNewScreen(null);
statusScreen.Dispose(); statusScreen.Dispose();
hudScreen.Dispose();
if (activeScreen != null) if (activeScreen != null)
activeScreen.Dispose(); activeScreen.Dispose();

View File

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