Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #352 from shuffle2/master
[windows] Fix debug build memory leaks.
  • Loading branch information
shuffle2 committed May 11, 2014
2 parents b4e1ac5 + fa65eeb commit adbb4c4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 22 deletions.
16 changes: 0 additions & 16 deletions Source/Core/Core/State.cpp
Expand Up @@ -427,16 +427,6 @@ void LoadAs(const std::string& filename)
// Stop the core while we load the state
bool wasUnpaused = Core::PauseAndLock(true);

#if defined _DEBUG && defined _WIN32
// we use _CRTDBG_DELAY_FREE_MEM_DF (as a speed hack?),
// but it was causing us to leak gigantic amounts of memory here,
// enough that only a few savestates could be loaded before crashing,
// so let's disable it temporarily.
int tmpflag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
if (g_loadDepth == 0)
_CrtSetDbgFlag(tmpflag & ~_CRTDBG_DELAY_FREE_MEM_DF);
#endif

g_loadDepth++;

// Save temp buffer for undo load state
Expand Down Expand Up @@ -494,12 +484,6 @@ void LoadAs(const std::string& filename)

g_loadDepth--;

#if defined _DEBUG && defined _WIN32
// restore _CRTDBG_DELAY_FREE_MEM_DF
if (g_loadDepth == 0)
_CrtSetDbgFlag(tmpflag);
#endif

// resume dat core
Core::PauseAndLock(false, wasUnpaused);
}
Expand Down
6 changes: 0 additions & 6 deletions Source/Core/DolphinWX/Main.cpp
Expand Up @@ -232,12 +232,6 @@ bool DolphinApp::OnInit()
}
#endif // wxUSE_CMDLINE_PARSER

#if defined _DEBUG && defined _WIN32
int tmpflag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
tmpflag |= _CRTDBG_DELAY_FREE_MEM_DF;
_CrtSetDbgFlag(tmpflag);
#endif

// Register message box and translation handlers
RegisterMsgAlertHandler(&wxMsgAlert);
RegisterStringTranslator(&wxStringTranslator);
Expand Down

0 comments on commit adbb4c4

Please sign in to comment.