From 9476756d4388c6e5f639f5cbf979612bff856293 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 30 Jan 2015 21:25:16 -0500 Subject: [PATCH] OGL: Fix a memory leak that would occur every time a game is launched --- Source/Core/VideoBackends/OGL/GLInterfaceBase.h | 1 + Source/Core/VideoBackends/OGL/main.cpp | 1 + Source/Core/VideoBackends/Software/SWmain.cpp | 1 + 3 files changed, 3 insertions(+) diff --git a/Source/Core/VideoBackends/OGL/GLInterfaceBase.h b/Source/Core/VideoBackends/OGL/GLInterfaceBase.h index 6f705bbf4f..13f88c8cad 100644 --- a/Source/Core/VideoBackends/OGL/GLInterfaceBase.h +++ b/Source/Core/VideoBackends/OGL/GLInterfaceBase.h @@ -24,6 +24,7 @@ protected: u32 s_opengl_mode; public: + virtual ~cInterfaceBase() {} virtual void Swap() {} virtual void SetMode(u32 mode) { s_opengl_mode = GLInterfaceMode::MODE_OPENGL; } virtual u32 GetMode() { return s_opengl_mode; } diff --git a/Source/Core/VideoBackends/OGL/main.cpp b/Source/Core/VideoBackends/OGL/main.cpp index 68565e50fd..5cd4f88124 100644 --- a/Source/Core/VideoBackends/OGL/main.cpp +++ b/Source/Core/VideoBackends/OGL/main.cpp @@ -225,6 +225,7 @@ void VideoBackend::Shutdown() OSD::DoCallbacks(OSD::OSD_SHUTDOWN); GLInterface->Shutdown(); + delete GLInterface; } void VideoBackend::Video_Cleanup() diff --git a/Source/Core/VideoBackends/Software/SWmain.cpp b/Source/Core/VideoBackends/Software/SWmain.cpp index 8f7c06c5a8..004ae5e2bf 100644 --- a/Source/Core/VideoBackends/Software/SWmain.cpp +++ b/Source/Core/VideoBackends/Software/SWmain.cpp @@ -163,6 +163,7 @@ void VideoSoftware::Shutdown() OSD::DoCallbacks(OSD::OSD_SHUTDOWN); GLInterface->Shutdown(); + delete GLInterface; } void VideoSoftware::Video_Cleanup()