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/physfsrwops.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/utils/physfsrwops.cpp') diff --git a/src/utils/physfsrwops.cpp b/src/utils/physfsrwops.cpp index 022e8160f..aa5caf7c7 100644 --- a/src/utils/physfsrwops.cpp +++ b/src/utils/physfsrwops.cpp @@ -27,6 +27,7 @@ #include "logger.h" #include "utils/fuzzer.h" +#include "utils/physfscheckutils.h" #include @@ -160,6 +161,9 @@ static int physfsrwops_close(SDL_RWops *const rw) if (openedRWops <= 0) logger->log("closing already closed RWops"); openedRWops --; +#endif +#ifdef DEBUG_PHYSFS + FakePhysFSClose(rw); #endif return 0; } /* physfsrwops_close */ @@ -256,10 +260,12 @@ SDL_RWops *PHYSFSRWOPS_openAppend(const char *const fname) return create_rwops(PhysFs::openAppend(fname)); } /* PHYSFSRWOPS_openAppend */ +#ifdef DUMP_LEAKED_RESOURCES void reportRWops() { if (openedRWops) logger->log("leaking RWops: %d", openedRWops); } +#endif /* end of physfsrwops.c ... */ -- cgit v1.2.3-60-g2f50