summaryrefslogtreecommitdiff
path: root/src/resources/resource.cpp
diff options
context:
space:
mode:
authorTametomo <irarice@gmail.com>2009-07-24 08:35:36 -0600
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2010-02-14 22:02:23 +0100
commit647d7871a25a3691fd8b4db12255c76c2b78f3d1 (patch)
tree87414716cdc404e786c7f4a3ac3a86c6ba2afd8e /src/resources/resource.cpp
parent493a27e1767aa224d6c1bd92b7f44706fc721ed0 (diff)
downloadmana-647d7871a25a3691fd8b4db12255c76c2b78f3d1.tar.gz
mana-647d7871a25a3691fd8b4db12255c76c2b78f3d1.tar.bz2
mana-647d7871a25a3691fd8b4db12255c76c2b78f3d1.tar.xz
mana-647d7871a25a3691fd8b4db12255c76c2b78f3d1.zip
Give more meaningful error messages when decRef() fails.
Signed-off-by: Tametomo <irarice@gmail.com>
Diffstat (limited to 'src/resources/resource.cpp')
-rw-r--r--src/resources/resource.cpp7
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--;