From 490d8be4df9f8a1b47ff83b3b5db1cce9fb822e7 Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Sun, 4 Oct 2015 12:24:59 +0200 Subject: [PATCH] Some cleanup, enable CRT memory tracker in debug builds --- Core/MIPS/x86/Asm.h | 7 ------- UI/GameInfoCache.cpp | 5 +++++ Windows/main.cpp | 9 +++++++++ 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Core/MIPS/x86/Asm.h b/Core/MIPS/x86/Asm.h index 085ffb5d0c..4b9bb77354 100644 --- a/Core/MIPS/x86/Asm.h +++ b/Core/MIPS/x86/Asm.h @@ -30,15 +30,8 @@ namespace MIPSComp { class AsmRoutineManager : public Gen::XCodeBlock { private: void Generate(MIPSState *mips, MIPSComp::Jit *jit, MIPSComp::JitOptions *jo); - void GenerateCommon(); public: - AsmRoutineManager() { - } - ~AsmRoutineManager() { - FreeCodeSpace(); - } - void Init(MIPSState *mips, MIPSComp::Jit *jit, MIPSComp::JitOptions *jo) { AllocCodeSpace(8192); Generate(mips, jit, jo); diff --git a/UI/GameInfoCache.cpp b/UI/GameInfoCache.cpp index 3faed1559b..e7c07e5a3a 100644 --- a/UI/GameInfoCache.cpp +++ b/UI/GameInfoCache.cpp @@ -15,6 +15,8 @@ // Official git repository and contact information can be found at // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. +#include "Common/Common.h" + #include #include #include @@ -45,6 +47,9 @@ GameInfoCache g_gameInfoCache; GameInfo::~GameInfo() { + delete iconTexture; + delete pic0Texture; + delete pic1Texture; delete fileLoader; } diff --git a/Windows/main.cpp b/Windows/main.cpp index 77abf43ecb..2b3fdfb49d 100644 --- a/Windows/main.cpp +++ b/Windows/main.cpp @@ -39,6 +39,7 @@ #include "Commctrl.h" +#include "UI/GameInfoCache.h" #include "Windows/resource.h" #include "Windows/MainWindow.h" @@ -347,6 +348,10 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin CoInitializeEx(NULL, COINIT_MULTITHREADED); +#ifdef _DEBUG + _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF|_CRTDBG_LEAK_CHECK_DF); +#endif + PROFILE_INIT(); // FMA3 support in the 2013 CRT is broken on Vista and Windows 7 RTM (fixed in SP1). Just disable it. @@ -597,11 +602,15 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin } g_Config.Save(); + g_gameInfoCache.Clear(); + g_gameInfoCache.Shutdown(); LogManager::Shutdown(); if (g_Config.bRestartRequired) { W32Util::ExitAndRestart(); } + CoUninitialize(); + return 0; }