diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-09-15 00:32:07 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-09-15 00:32:07 +0300 |
commit | 57288890689bfa2c2d35882169a539813be621f1 (patch) | |
tree | 8c2886837e997d073906cb85aee38c9d77a8069b /src/utils/sdlcheckutils.cpp | |
parent | 53947c9d39440424dcf815ea5df130e833457437 (diff) | |
download | plus-57288890689bfa2c2d35882169a539813be621f1.tar.gz plus-57288890689bfa2c2d35882169a539813be621f1.tar.bz2 plus-57288890689bfa2c2d35882169a539813be621f1.tar.xz plus-57288890689bfa2c2d35882169a539813be621f1.zip |
add RWops leaks reporting.
Diffstat (limited to 'src/utils/sdlcheckutils.cpp')
-rw-r--r-- | src/utils/sdlcheckutils.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/utils/sdlcheckutils.cpp b/src/utils/sdlcheckutils.cpp index 50adedb28..3810672d9 100644 --- a/src/utils/sdlcheckutils.cpp +++ b/src/utils/sdlcheckutils.cpp @@ -35,10 +35,10 @@ #define DEBUG_SURFACE_ALLOCATION 1 -struct SurfaceObject +struct MemoryObject { - SurfaceObject(const std::string &name, const char *const file, - const unsigned int line) : + MemoryObject(const std::string &name, const char *const file, + const unsigned int line) : mName(name), mAddFile(strprintf("%s:%u", file, line)), mRemoveFile(), @@ -52,7 +52,7 @@ struct SurfaceObject int mCnt; }; -std::map<SDL_Surface*, SurfaceObject*> mSurfaces; +std::map<void*, MemoryObject*> mSurfaces; static SDL_Surface *addSurface(const char *const name, SDL_Surface *const surface, @@ -63,11 +63,11 @@ static SDL_Surface *addSurface(const char *const name, logger->log("add surface: %s %s:%u %p", name, file, line, static_cast<void*>(surface)); #endif - std::map<SDL_Surface*, SurfaceObject*>::iterator + std::map<void*, MemoryObject*>::iterator it = mSurfaces.find(surface); if (it != mSurfaces.end()) { - SurfaceObject *const obj = (*it).second; + MemoryObject *const obj = (*it).second; if (obj) { // found some time ago created surface #ifdef DEBUG_SURFACE_ALLOCATION @@ -80,7 +80,7 @@ static SDL_Surface *addSurface(const char *const name, } else { // creating surface object - mSurfaces[surface] = new SurfaceObject(name, file, line); + mSurfaces[surface] = new MemoryObject(name, file, line); } return surface; } @@ -93,7 +93,7 @@ static void deleteSurface(const char *const name A_UNUSED, #ifdef DEBUG_SURFACE_ALLOCATION logger->log("delete surface: %s %s:%u %p", name, file, line, surface); #endif - std::map<SDL_Surface*, SurfaceObject*>::iterator + std::map<void*, MemoryObject*>::iterator it = mSurfaces.find(surface); if (it == mSurfaces.end()) { @@ -102,7 +102,7 @@ static void deleteSurface(const char *const name A_UNUSED, } else { - SurfaceObject *const obj = (*it).second; + MemoryObject *const obj = (*it).second; if (obj) { const int cnt = obj->mCnt; |