1
0

Use leakfinder in debug builds to dump all currently used memory via the "dumpmem" console command.

git-svn-id: http://mc-server.googlecode.com/svn/trunk@984 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com
2012-10-19 22:09:33 +00:00
parent 6a5ebcd6ca
commit d2780443c6
4 changed files with 143 additions and 218 deletions

View File

@@ -38,6 +38,20 @@ extern "C" {
// For the "dumpmem" server command:
/// Synchronize this with main.cpp - the leak finder needs initialization before it can be used to dump memory
#define ENABLE_LEAK_FINDER
#if defined(_MSC_VER) && defined(_DEBUG) && defined(ENABLE_LEAK_FINDER)
#pragma warning(push)
#pragma warning(disable:4100)
#include "LeakFinder.h"
#pragma warning(pop)
#endif
typedef std::list< cClientHandle* > ClientList;
@@ -528,6 +542,15 @@ void cServer::ServerCommand(const AString & a_Cmd)
return;
}
#if defined(_MSC_VER) && defined(_DEBUG) && defined(ENABLE_LEAK_FINDER)
if (split[0].compare("dumpmem") == 0)
{
LeakFinderXmlOutput Output("memdump.xml");
DumpUsedMemory(&Output);
return;
}
#endif
if (split.size() > 1)
{
if (split[0].compare("say") == 0)