summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-05-24 00:38:44 +0300
committerAndrei Karas <akaras@inbox.ru>2011-05-24 00:38:44 +0300
commitd2c42029b98c665725768b891aa877eb3267664f (patch)
treeb232b9a20e45ecb4e7ec2133d7806669054708a6 /src/net
parentfe39570810969993f51a0ff6045d0a5d4397a5e5 (diff)
downloadmanaverse-d2c42029b98c665725768b891aa877eb3267664f.tar.gz
manaverse-d2c42029b98c665725768b891aa877eb3267664f.tar.bz2
manaverse-d2c42029b98c665725768b891aa877eb3267664f.tar.xz
manaverse-d2c42029b98c665725768b891aa877eb3267664f.zip
Add simple memory leak detector.
Can be enabled by configure option -enable-memdebug=yes. Known issue: not all memory allocations hooked with it.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/charhandler.cpp2
-rw-r--r--src/net/download.cpp3
-rw-r--r--src/net/ea/adminhandler.cpp2
-rw-r--r--src/net/ea/beinghandler.cpp2
-rw-r--r--src/net/ea/buysellhandler.cpp2
-rw-r--r--src/net/messagein.cpp2
-rw-r--r--src/net/messageout.cpp2
-rw-r--r--src/net/net.cpp2
-rw-r--r--src/net/packetcounters.cpp2
-rw-r--r--src/net/tmwa/adminhandler.cpp2
-rw-r--r--src/net/tmwa/beinghandler.cpp2
-rw-r--r--src/net/tmwa/buysellhandler.cpp2
-rw-r--r--src/net/tmwa/charserverhandler.cpp2
-rw-r--r--src/net/tmwa/chathandler.cpp2
-rw-r--r--src/net/tmwa/gamehandler.cpp2
-rw-r--r--src/net/tmwa/generalhandler.cpp2
-rw-r--r--src/net/tmwa/gui/guildtab.cpp2
-rw-r--r--src/net/tmwa/gui/partytab.cpp2
-rw-r--r--src/net/tmwa/guildhandler.cpp2
-rw-r--r--src/net/tmwa/inventoryhandler.cpp2
-rw-r--r--src/net/tmwa/itemhandler.cpp2
-rw-r--r--src/net/tmwa/loginhandler.cpp2
-rw-r--r--src/net/tmwa/messagehandler.cpp2
-rw-r--r--src/net/tmwa/messagein.cpp2
-rw-r--r--src/net/tmwa/messageout.cpp2
-rw-r--r--src/net/tmwa/network.cpp2
-rw-r--r--src/net/tmwa/npchandler.cpp2
-rw-r--r--src/net/tmwa/partyhandler.cpp2
-rw-r--r--src/net/tmwa/playerhandler.cpp2
-rw-r--r--src/net/tmwa/specialhandler.cpp2
-rw-r--r--src/net/tmwa/tradehandler.cpp2
31 files changed, 62 insertions, 1 deletions
diff --git a/src/net/charhandler.cpp b/src/net/charhandler.cpp
index c7474c7f3..f3a02fc3b 100644
--- a/src/net/charhandler.cpp
+++ b/src/net/charhandler.cpp
@@ -23,6 +23,8 @@
#include "gui/charselectdialog.h"
+#include "debug.h"
+
using namespace Net;
void CharHandler::updateCharSelectDialog()
diff --git a/src/net/download.cpp b/src/net/download.cpp
index 1badf1763..1da792c52 100644
--- a/src/net/download.cpp
+++ b/src/net/download.cpp
@@ -34,10 +34,11 @@
#include <zlib.h>
+#include "debug.h"
+
const char *DOWNLOAD_ERROR_MESSAGE_THREAD
= "Could not create download thread!";
-
enum
{
OPTIONS_NONE = 0,
diff --git a/src/net/ea/adminhandler.cpp b/src/net/ea/adminhandler.cpp
index 9dd525ae9..3554a9d9e 100644
--- a/src/net/ea/adminhandler.cpp
+++ b/src/net/ea/adminhandler.cpp
@@ -27,6 +27,8 @@
#include <string>
+#include "debug.h"
+
namespace Ea
{
diff --git a/src/net/ea/beinghandler.cpp b/src/net/ea/beinghandler.cpp
index f59283e23..6875a067e 100644
--- a/src/net/ea/beinghandler.cpp
+++ b/src/net/ea/beinghandler.cpp
@@ -51,6 +51,8 @@
#include <iostream>
+#include "debug.h"
+
namespace Ea
{
const int EMOTION_TIME = 500; /**< Duration of emotion icon */
diff --git a/src/net/ea/buysellhandler.cpp b/src/net/ea/buysellhandler.cpp
index 2ee586c92..685562d6f 100644
--- a/src/net/ea/buysellhandler.cpp
+++ b/src/net/ea/buysellhandler.cpp
@@ -44,6 +44,8 @@
#include "utils/gettext.h"
+#include "debug.h"
+
namespace Ea
{
diff --git a/src/net/messagein.cpp b/src/net/messagein.cpp
index 9b76c76fa..8b5f2eee3 100644
--- a/src/net/messagein.cpp
+++ b/src/net/messagein.cpp
@@ -29,6 +29,8 @@
#include "utils/stringutils.h"
+#include "debug.h"
+
#define MAKEWORD(low, high) \
(static_cast<unsigned short>((static_cast<unsigned char>(low)) | \
(static_cast<unsigned short>(static_cast<unsigned char>(high))) << 8))
diff --git a/src/net/messageout.cpp b/src/net/messageout.cpp
index db7f4842e..24edb4079 100644
--- a/src/net/messageout.cpp
+++ b/src/net/messageout.cpp
@@ -31,6 +31,8 @@
#include <cstring>
#include <string>
+#include "debug.h"
+
namespace Net
{
diff --git a/src/net/net.cpp b/src/net/net.cpp
index ca26415a6..49bb58903 100644
--- a/src/net/net.cpp
+++ b/src/net/net.cpp
@@ -46,6 +46,8 @@
#include "net/manaserv/generalhandler.h"
#endif
+#include "debug.h"
+
Net::AdminHandler *adminHandler = NULL;
Net::CharHandler *charHandler = NULL;
Net::ChatHandler *chatHandler = NULL;
diff --git a/src/net/packetcounters.cpp b/src/net/packetcounters.cpp
index f6a1dfec3..8cd2e4627 100644
--- a/src/net/packetcounters.cpp
+++ b/src/net/packetcounters.cpp
@@ -22,6 +22,8 @@
#include "net/packetcounters.h"
+#include "debug.h"
+
extern volatile int cur_time;
extern volatile bool runCounters;
diff --git a/src/net/tmwa/adminhandler.cpp b/src/net/tmwa/adminhandler.cpp
index 45a285d02..cbd16bd39 100644
--- a/src/net/tmwa/adminhandler.cpp
+++ b/src/net/tmwa/adminhandler.cpp
@@ -41,6 +41,8 @@
#include <string>
+#include "debug.h"
+
extern Net::AdminHandler *adminHandler;
namespace TmwAthena
diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp
index ff458b31b..7589553ff 100644
--- a/src/net/tmwa/beinghandler.cpp
+++ b/src/net/tmwa/beinghandler.cpp
@@ -51,6 +51,8 @@
#include <iostream>
+#include "debug.h"
+
extern Net::BeingHandler *beingHandler;
namespace TmwAthena
diff --git a/src/net/tmwa/buysellhandler.cpp b/src/net/tmwa/buysellhandler.cpp
index 0b839a3f5..fa509ffec 100644
--- a/src/net/tmwa/buysellhandler.cpp
+++ b/src/net/tmwa/buysellhandler.cpp
@@ -47,6 +47,8 @@
#include "utils/gettext.h"
+#include "debug.h"
+
extern Net::BuySellHandler *buySellHandler;
namespace TmwAthena
diff --git a/src/net/tmwa/charserverhandler.cpp b/src/net/tmwa/charserverhandler.cpp
index 7f091bc67..defe7925a 100644
--- a/src/net/tmwa/charserverhandler.cpp
+++ b/src/net/tmwa/charserverhandler.cpp
@@ -46,6 +46,8 @@
#include "utils/gettext.h"
#include "utils/stringutils.h"
+#include "debug.h"
+
extern Net::CharHandler *charHandler;
namespace TmwAthena
diff --git a/src/net/tmwa/chathandler.cpp b/src/net/tmwa/chathandler.cpp
index 3a3b45a3c..b4ae395c3 100644
--- a/src/net/tmwa/chathandler.cpp
+++ b/src/net/tmwa/chathandler.cpp
@@ -46,6 +46,8 @@
#include <string>
+#include "debug.h"
+
extern Net::ChatHandler *chatHandler;
namespace TmwAthena
diff --git a/src/net/tmwa/gamehandler.cpp b/src/net/tmwa/gamehandler.cpp
index b1f72a834..99d4841b2 100644
--- a/src/net/tmwa/gamehandler.cpp
+++ b/src/net/tmwa/gamehandler.cpp
@@ -40,6 +40,8 @@
#include "utils/gettext.h"
#include "utils/stringutils.h"
+#include "debug.h"
+
extern Net::GameHandler *gameHandler;
namespace TmwAthena
diff --git a/src/net/tmwa/generalhandler.cpp b/src/net/tmwa/generalhandler.cpp
index 26f6983d7..2e9070eb7 100644
--- a/src/net/tmwa/generalhandler.cpp
+++ b/src/net/tmwa/generalhandler.cpp
@@ -65,6 +65,8 @@
#include <assert.h>
#include <list>
+#include "debug.h"
+
extern Net::GeneralHandler *generalHandler;
namespace TmwAthena
diff --git a/src/net/tmwa/gui/guildtab.cpp b/src/net/tmwa/gui/guildtab.cpp
index 714f08b46..ce828b338 100644
--- a/src/net/tmwa/gui/guildtab.cpp
+++ b/src/net/tmwa/gui/guildtab.cpp
@@ -39,6 +39,8 @@
#include "utils/gettext.h"
#include "utils/stringutils.h"
+#include "debug.h"
+
namespace TmwAthena
{
diff --git a/src/net/tmwa/gui/partytab.cpp b/src/net/tmwa/gui/partytab.cpp
index 84d846c7f..fc8ec138d 100644
--- a/src/net/tmwa/gui/partytab.cpp
+++ b/src/net/tmwa/gui/partytab.cpp
@@ -41,6 +41,8 @@
#include "net/chathandler.h"
+#include "debug.h"
+
namespace TmwAthena
{
diff --git a/src/net/tmwa/guildhandler.cpp b/src/net/tmwa/guildhandler.cpp
index f2552d4c8..b70059baa 100644
--- a/src/net/tmwa/guildhandler.cpp
+++ b/src/net/tmwa/guildhandler.cpp
@@ -37,6 +37,8 @@
#include "utils/gettext.h"
+#include "debug.h"
+
extern Net::GuildHandler *guildHandler;
namespace TmwAthena
diff --git a/src/net/tmwa/inventoryhandler.cpp b/src/net/tmwa/inventoryhandler.cpp
index 3e8e89703..ecf875b78 100644
--- a/src/net/tmwa/inventoryhandler.cpp
+++ b/src/net/tmwa/inventoryhandler.cpp
@@ -47,6 +47,8 @@
#include <SDL_types.h>
+#include "debug.h"
+
extern Net::InventoryHandler *inventoryHandler;
const Equipment::Slot EQUIP_POINTS[Equipment::EQUIP_VECTOREND] =
diff --git a/src/net/tmwa/itemhandler.cpp b/src/net/tmwa/itemhandler.cpp
index 897ed1fb5..d9595c846 100644
--- a/src/net/tmwa/itemhandler.cpp
+++ b/src/net/tmwa/itemhandler.cpp
@@ -28,6 +28,8 @@
#include "net/tmwa/protocol.h"
+#include "debug.h"
+
namespace TmwAthena
{
diff --git a/src/net/tmwa/loginhandler.cpp b/src/net/tmwa/loginhandler.cpp
index 7f73057b4..b1af0900d 100644
--- a/src/net/tmwa/loginhandler.cpp
+++ b/src/net/tmwa/loginhandler.cpp
@@ -37,6 +37,8 @@
#include "utils/gettext.h"
#include "utils/stringutils.h"
+#include "debug.h"
+
extern Net::LoginHandler *loginHandler;
namespace TmwAthena
diff --git a/src/net/tmwa/messagehandler.cpp b/src/net/tmwa/messagehandler.cpp
index fc3d9f752..843339718 100644
--- a/src/net/tmwa/messagehandler.cpp
+++ b/src/net/tmwa/messagehandler.cpp
@@ -26,6 +26,8 @@
#include <cassert>
+#include "debug.h"
+
namespace TmwAthena
{
diff --git a/src/net/tmwa/messagein.cpp b/src/net/tmwa/messagein.cpp
index ca32b1df4..6e2fcc187 100644
--- a/src/net/tmwa/messagein.cpp
+++ b/src/net/tmwa/messagein.cpp
@@ -31,6 +31,8 @@
#include <SDL.h>
#include <SDL_endian.h>
+#include "debug.h"
+
#define MAKEWORD(low, high) \
((unsigned short)(((unsigned char)(low)) | \
((unsigned short)((unsigned char)(high))) << 8))
diff --git a/src/net/tmwa/messageout.cpp b/src/net/tmwa/messageout.cpp
index b6fcc09a1..a904b6bbb 100644
--- a/src/net/tmwa/messageout.cpp
+++ b/src/net/tmwa/messageout.cpp
@@ -36,6 +36,8 @@
#include <cstring>
#include <string>
+#include "debug.h"
+
namespace TmwAthena
{
diff --git a/src/net/tmwa/network.cpp b/src/net/tmwa/network.cpp
index 5beb05c20..9207522e1 100644
--- a/src/net/tmwa/network.cpp
+++ b/src/net/tmwa/network.cpp
@@ -35,6 +35,8 @@
#include <assert.h>
#include <sstream>
+#include "debug.h"
+
/** Warning: buffers and other variables are shared,
so there can be only one connection active at a time */
diff --git a/src/net/tmwa/npchandler.cpp b/src/net/tmwa/npchandler.cpp
index f70e8cd03..688635942 100644
--- a/src/net/tmwa/npchandler.cpp
+++ b/src/net/tmwa/npchandler.cpp
@@ -36,6 +36,8 @@
#include <SDL_types.h>
+#include "debug.h"
+
extern Net::NpcHandler *npcHandler;
namespace TmwAthena
diff --git a/src/net/tmwa/partyhandler.cpp b/src/net/tmwa/partyhandler.cpp
index 4ce77fbf4..152348d78 100644
--- a/src/net/tmwa/partyhandler.cpp
+++ b/src/net/tmwa/partyhandler.cpp
@@ -37,6 +37,8 @@
#include "utils/gettext.h"
#include "utils/stringutils.h"
+#include "debug.h"
+
#define PARTY_ID 1
extern Net::PartyHandler *partyHandler;
diff --git a/src/net/tmwa/playerhandler.cpp b/src/net/tmwa/playerhandler.cpp
index 385c7ca15..e0f3e5c29 100644
--- a/src/net/tmwa/playerhandler.cpp
+++ b/src/net/tmwa/playerhandler.cpp
@@ -46,6 +46,8 @@
#include "utils/stringutils.h"
#include "utils/gettext.h"
+#include "debug.h"
+
extern OkDialog *weightNotice;
extern OkDialog *deathNotice;
extern int weightNoticeTime;
diff --git a/src/net/tmwa/specialhandler.cpp b/src/net/tmwa/specialhandler.cpp
index 586f5fe00..19713a0bf 100644
--- a/src/net/tmwa/specialhandler.cpp
+++ b/src/net/tmwa/specialhandler.cpp
@@ -36,6 +36,8 @@
#include "utils/gettext.h"
+#include "debug.h"
+
/** job dependend identifiers (?) */
#define SKILL_BASIC 0x0001
#define SKILL_WARP 0x001b
diff --git a/src/net/tmwa/tradehandler.cpp b/src/net/tmwa/tradehandler.cpp
index 19c32bd71..f7d6787d0 100644
--- a/src/net/tmwa/tradehandler.cpp
+++ b/src/net/tmwa/tradehandler.cpp
@@ -42,6 +42,8 @@
#include "utils/gettext.h"
#include "utils/stringutils.h"
+#include "debug.h"
+
extern std::string tradePartnerName;
ConfirmDialog *confirmDlg;