Permalink
Browse files

Fix some texture leaks on game exit

  • Loading branch information...
UnknownShadow200 committed Nov 26, 2018
1 parent b11d518 commit b2a6fd87ec01c41a09eba8ebe118656816c05e14
Showing with 3 additions and 0 deletions.
  1. +2 −0 ClassicalSharp/Game/GuiInterface.cs
  2. +1 −0 src/Gui.c
@@ -55,7 +55,9 @@ public sealed class GuiInterface : IGameComponent {
void IDisposable.Dispose() {
Events.TextureChanged -= TextureChanged;
SetNewScreen(null);

statusScreen.Dispose();
hudScreen.Dispose();

if (activeScreen != null)
activeScreen.Dispose();
@@ -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);

0 comments on commit b2a6fd8

Please sign in to comment.