summaryrefslogtreecommitdiffstats
path: root/source/Server.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/Server.cpp')
-rw-r--r--source/Server.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/source/Server.cpp b/source/Server.cpp
index 8b1fd3c1e..ea25392a5 100644
--- a/source/Server.cpp
+++ b/source/Server.cpp
@@ -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)