From 57288890689bfa2c2d35882169a539813be621f1 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 15 Sep 2013 00:32:07 +0300 Subject: add RWops leaks reporting. --- src/utils/sdlcheckutils.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/utils/sdlcheckutils.cpp') 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 mSurfaces; +std::map 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(surface)); #endif - std::map::iterator + std::map::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::iterator + std::map::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; -- cgit v1.2.3-70-g09d2