diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-05-24 00:38:44 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-05-24 00:38:44 +0300 |
commit | d2c42029b98c665725768b891aa877eb3267664f (patch) | |
tree | b232b9a20e45ecb4e7ec2133d7806669054708a6 /src/resources | |
parent | fe39570810969993f51a0ff6045d0a5d4397a5e5 (diff) | |
download | manaverse-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/resources')
-rw-r--r-- | src/resources/action.cpp | 2 | ||||
-rw-r--r-- | src/resources/ambientlayer.cpp | 2 | ||||
-rw-r--r-- | src/resources/animation.cpp | 2 | ||||
-rw-r--r-- | src/resources/beinginfo.cpp | 2 | ||||
-rw-r--r-- | src/resources/colordb.cpp | 2 | ||||
-rw-r--r-- | src/resources/dye.cpp | 2 | ||||
-rw-r--r-- | src/resources/emotedb.cpp | 2 | ||||
-rw-r--r-- | src/resources/image.cpp | 2 | ||||
-rw-r--r-- | src/resources/imageloader.cpp | 6 | ||||
-rw-r--r-- | src/resources/imageset.cpp | 2 | ||||
-rw-r--r-- | src/resources/imagewriter.cpp | 2 | ||||
-rw-r--r-- | src/resources/itemdb.cpp | 2 | ||||
-rw-r--r-- | src/resources/iteminfo.cpp | 2 | ||||
-rw-r--r-- | src/resources/mapdb.cpp | 2 | ||||
-rw-r--r-- | src/resources/mapreader.cpp | 2 | ||||
-rw-r--r-- | src/resources/monsterdb.cpp | 2 | ||||
-rw-r--r-- | src/resources/music.cpp | 2 | ||||
-rw-r--r-- | src/resources/npcdb.cpp | 2 | ||||
-rw-r--r-- | src/resources/resource.cpp | 2 | ||||
-rw-r--r-- | src/resources/resourcemanager.cpp | 2 | ||||
-rw-r--r-- | src/resources/soundeffect.cpp | 2 | ||||
-rw-r--r-- | src/resources/specialdb.cpp | 1 | ||||
-rw-r--r-- | src/resources/spritedef.cpp | 2 | ||||
-rw-r--r-- | src/resources/wallpaper.cpp | 3 |
24 files changed, 50 insertions, 2 deletions
diff --git a/src/resources/action.cpp b/src/resources/action.cpp index 23941f955..a95ebc5e3 100644 --- a/src/resources/action.cpp +++ b/src/resources/action.cpp @@ -27,6 +27,8 @@ #include "utils/dtor.h" +#include "debug.h" + Action::Action() { } diff --git a/src/resources/ambientlayer.cpp b/src/resources/ambientlayer.cpp index 145de8e79..92d9eb43e 100644 --- a/src/resources/ambientlayer.cpp +++ b/src/resources/ambientlayer.cpp @@ -26,6 +26,8 @@ #include "resources/image.h" #include "resources/resourcemanager.h" +#include "debug.h" + AmbientLayer::AmbientLayer(Image *img, float parallax, float speedX, float speedY, bool keepRatio): mImage(img), mParallax(parallax), diff --git a/src/resources/animation.cpp b/src/resources/animation.cpp index 10b017cd1..915d7ef30 100644 --- a/src/resources/animation.cpp +++ b/src/resources/animation.cpp @@ -24,6 +24,8 @@ #include "utils/dtor.h" +#include "debug.h" + Animation::Animation(): mDuration(0) { diff --git a/src/resources/beinginfo.cpp b/src/resources/beinginfo.cpp index 438de46dd..7114290ca 100644 --- a/src/resources/beinginfo.cpp +++ b/src/resources/beinginfo.cpp @@ -27,6 +27,8 @@ #include "utils/dtor.h" #include "utils/gettext.h" +#include "debug.h" + BeingInfo *BeingInfo::Unknown = new BeingInfo; BeingInfo::BeingInfo(): diff --git a/src/resources/colordb.cpp b/src/resources/colordb.cpp index 30d7c4f0c..2d4e9687e 100644 --- a/src/resources/colordb.cpp +++ b/src/resources/colordb.cpp @@ -27,6 +27,8 @@ #include <libxml/tree.h> +#include "debug.h" + namespace { ColorDB::Colors mHairColors; diff --git a/src/resources/dye.cpp b/src/resources/dye.cpp index 2d621127b..fe7d4bcac 100644 --- a/src/resources/dye.cpp +++ b/src/resources/dye.cpp @@ -27,6 +27,8 @@ #include <math.h> #include <sstream> +#include "debug.h" + DyePalette::DyePalette(const std::string &description) { int size = static_cast<int>(description.length()); diff --git a/src/resources/emotedb.cpp b/src/resources/emotedb.cpp index d0cb84b90..85a2993dd 100644 --- a/src/resources/emotedb.cpp +++ b/src/resources/emotedb.cpp @@ -26,6 +26,8 @@ #include "utils/xml.h" #include "configuration.h" +#include "debug.h" + namespace { EmoteInfos mEmoteInfos; diff --git a/src/resources/image.cpp b/src/resources/image.cpp index be7bb7f47..aa5c33488 100644 --- a/src/resources/image.cpp +++ b/src/resources/image.cpp @@ -39,6 +39,8 @@ #include <SDL_image.h> #include <SDL_rotozoom.h> +#include "debug.h" + #ifdef USE_OPENGL int Image::mUseOpenGL = 0; int Image::mTextureType = 0; diff --git a/src/resources/imageloader.cpp b/src/resources/imageloader.cpp index d0c82c09f..fa5d0eea1 100644 --- a/src/resources/imageloader.cpp +++ b/src/resources/imageloader.cpp @@ -31,6 +31,12 @@ #include <cassert> +#include "debug.h" + +#ifdef free +#undef free +#endif + ProxyImage::ProxyImage(SDL_Surface *s): mImage(NULL), mSDLImage(s) { diff --git a/src/resources/imageset.cpp b/src/resources/imageset.cpp index af180b0eb..1d41c6e63 100644 --- a/src/resources/imageset.cpp +++ b/src/resources/imageset.cpp @@ -28,6 +28,8 @@ #include "utils/dtor.h" +#include "debug.h" + ImageSet::ImageSet(Image *img, int width, int height, int margin, int spacing) : mOffsetX(0), diff --git a/src/resources/imagewriter.cpp b/src/resources/imagewriter.cpp index d5d3de898..d068b9c02 100644 --- a/src/resources/imagewriter.cpp +++ b/src/resources/imagewriter.cpp @@ -28,6 +28,8 @@ #include <SDL.h> #include <string> +#include "debug.h" + bool ImageWriter::writePNG(SDL_Surface *surface, const std::string &filename) { if (!surface) diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp index 234394cbe..b4e33dfa7 100644 --- a/src/resources/itemdb.cpp +++ b/src/resources/itemdb.cpp @@ -38,6 +38,8 @@ #include <cassert> +#include "debug.h" + namespace { ItemDB::ItemInfos mItemInfos; diff --git a/src/resources/iteminfo.cpp b/src/resources/iteminfo.cpp index 09813c43f..3eea45360 100644 --- a/src/resources/iteminfo.cpp +++ b/src/resources/iteminfo.cpp @@ -28,6 +28,8 @@ #include <set> #include <map> +#include "debug.h" + const std::string &ItemInfo::getSprite(Gender gender) const { if (mView) diff --git a/src/resources/mapdb.cpp b/src/resources/mapdb.cpp index 0b553e35d..e8aeaf168 100644 --- a/src/resources/mapdb.cpp +++ b/src/resources/mapdb.cpp @@ -29,6 +29,8 @@ #include <libxml/tree.h> +#include "debug.h" + namespace { bool mLoaded = false; diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp index 6d0a6fa4f..c5e52ae7c 100644 --- a/src/resources/mapreader.cpp +++ b/src/resources/mapreader.cpp @@ -41,6 +41,8 @@ #include <iostream> #include <zlib.h> +#include "debug.h" + int inflateMemory(unsigned char *in, unsigned int inLength, unsigned char *&out, unsigned int &outLength); diff --git a/src/resources/monsterdb.cpp b/src/resources/monsterdb.cpp index ac5b2c7f9..f0739296a 100644 --- a/src/resources/monsterdb.cpp +++ b/src/resources/monsterdb.cpp @@ -34,6 +34,8 @@ #include "configuration.h" +#include "debug.h" + #define OLD_TMWATHENA_OFFSET 1002 namespace diff --git a/src/resources/music.cpp b/src/resources/music.cpp index 2fb296db9..ccd1d9280 100644 --- a/src/resources/music.cpp +++ b/src/resources/music.cpp @@ -24,6 +24,8 @@ #include "log.h" +#include "debug.h" + Music::Music(Mix_Chunk *music): mChunk(music), mChannel(-1) diff --git a/src/resources/npcdb.cpp b/src/resources/npcdb.cpp index 5c8c0e8c8..6f539e17b 100644 --- a/src/resources/npcdb.cpp +++ b/src/resources/npcdb.cpp @@ -30,6 +30,8 @@ #include "utils/xml.h" #include "configuration.h" +#include "debug.h" + namespace { BeingInfos mNPCInfos; diff --git a/src/resources/resource.cpp b/src/resources/resource.cpp index 550a2ea32..6e986272a 100644 --- a/src/resources/resource.cpp +++ b/src/resources/resource.cpp @@ -29,6 +29,8 @@ #include <cassert> +#include "debug.h" + Resource::~Resource() { } diff --git a/src/resources/resourcemanager.cpp b/src/resources/resourcemanager.cpp index 0c1dafe4b..79231a744 100644 --- a/src/resources/resourcemanager.cpp +++ b/src/resources/resourcemanager.cpp @@ -41,6 +41,8 @@ #include <sys/time.h> +#include "debug.h" + #define THEMES_FOLDER "themes" ResourceManager *ResourceManager::instance = NULL; diff --git a/src/resources/soundeffect.cpp b/src/resources/soundeffect.cpp index 7219ab624..a01bf21a0 100644 --- a/src/resources/soundeffect.cpp +++ b/src/resources/soundeffect.cpp @@ -24,6 +24,8 @@ #include "log.h" +#include "debug.h" + SoundEffect::~SoundEffect() { Mix_FreeChunk(mChunk); diff --git a/src/resources/specialdb.cpp b/src/resources/specialdb.cpp index 1115a693d..4ab5e2a91 100644 --- a/src/resources/specialdb.cpp +++ b/src/resources/specialdb.cpp @@ -26,6 +26,7 @@ #include "utils/dtor.h" #include "utils/xml.h" +#include "debug.h" namespace { diff --git a/src/resources/spritedef.cpp b/src/resources/spritedef.cpp index 1eea6547d..2cd59ee29 100644 --- a/src/resources/spritedef.cpp +++ b/src/resources/spritedef.cpp @@ -37,6 +37,8 @@ #include <set> +#include "debug.h" + SpriteReference *SpriteReference::Empty = new SpriteReference( paths.getStringValue("spriteErrorFile"), 0); diff --git a/src/resources/wallpaper.cpp b/src/resources/wallpaper.cpp index a2e3861e9..397b87993 100644 --- a/src/resources/wallpaper.cpp +++ b/src/resources/wallpaper.cpp @@ -35,8 +35,7 @@ #include <time.h> #include <vector> -//define WALLPAPER_FOLDER "graphics/images/" -//define WALLPAPER_BASE "login_wallpaper.png" +#include "debug.h" struct WallpaperData { |