summaryrefslogtreecommitdiffstats
path: root/source/Server.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-10-20 00:09:33 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-10-20 00:09:33 +0200
commitd2780443c64e058f0840c3ab7ea6a0a8c12e7343 (patch)
tree3b23790a86da6343a50968bcea2b3962c0bfc0ed /source/Server.cpp
parentRavines: Drill only through specific blocks (FS #259) (diff)
downloadcuberite-d2780443c64e058f0840c3ab7ea6a0a8c12e7343.tar
cuberite-d2780443c64e058f0840c3ab7ea6a0a8c12e7343.tar.gz
cuberite-d2780443c64e058f0840c3ab7ea6a0a8c12e7343.tar.bz2
cuberite-d2780443c64e058f0840c3ab7ea6a0a8c12e7343.tar.lz
cuberite-d2780443c64e058f0840c3ab7ea6a0a8c12e7343.tar.xz
cuberite-d2780443c64e058f0840c3ab7ea6a0a8c12e7343.tar.zst
cuberite-d2780443c64e058f0840c3ab7ea6a0a8c12e7343.zip
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)