diff options
author | Tametomo <irarice@gmail.com> | 2009-07-24 08:35:36 -0600 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2010-02-14 22:02:23 +0100 |
commit | 647d7871a25a3691fd8b4db12255c76c2b78f3d1 (patch) | |
tree | 87414716cdc404e786c7f4a3ac3a86c6ba2afd8e /src | |
parent | 493a27e1767aa224d6c1bd92b7f44706fc721ed0 (diff) | |
download | mana-client-647d7871a25a3691fd8b4db12255c76c2b78f3d1.tar.gz mana-client-647d7871a25a3691fd8b4db12255c76c2b78f3d1.tar.bz2 mana-client-647d7871a25a3691fd8b4db12255c76c2b78f3d1.tar.xz mana-client-647d7871a25a3691fd8b4db12255c76c2b78f3d1.zip |
Give more meaningful error messages when decRef() fails.
Signed-off-by: Tametomo <irarice@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/resources/resource.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/resources/resource.cpp b/src/resources/resource.cpp index 8701100c..9eff8d8e 100644 --- a/src/resources/resource.cpp +++ b/src/resources/resource.cpp @@ -21,9 +21,11 @@ #include "resources/resource.h" +#include "log.h" + #include "resources/resourcemanager.h" -#include <cassert> +#include "utils/stringutils.h" Resource::~Resource() { @@ -37,7 +39,8 @@ void Resource::incRef() void Resource::decRef() { // Reference may not already have reached zero - assert(mRefCount != 0); + if (mRefCount == 0) + logger->error(strprintf("mRefCount may not be zero for %s", mIdPath.c_str())); mRefCount--; |