diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2010-02-14 22:03:46 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2010-02-14 22:06:11 +0100 |
commit | 4126672a610952629938a5b1affb220d3336f5ed (patch) | |
tree | 084e5332808f0f64b37089a0b492edc282aa1624 /src/resources/resource.cpp | |
parent | 647d7871a25a3691fd8b4db12255c76c2b78f3d1 (diff) | |
download | mana-4126672a610952629938a5b1affb220d3336f5ed.tar.gz mana-4126672a610952629938a5b1affb220d3336f5ed.tar.bz2 mana-4126672a610952629938a5b1affb220d3336f5ed.tar.xz mana-4126672a610952629938a5b1affb220d3336f5ed.zip |
Don't quit the client on invalid decRef
It's not a fatal error.
Diffstat (limited to 'src/resources/resource.cpp')
-rw-r--r-- | src/resources/resource.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/resources/resource.cpp b/src/resources/resource.cpp index 9eff8d8e..bd6b2dc6 100644 --- a/src/resources/resource.cpp +++ b/src/resources/resource.cpp @@ -25,7 +25,7 @@ #include "resources/resourcemanager.h" -#include "utils/stringutils.h" +#include <cassert> Resource::~Resource() { @@ -39,8 +39,10 @@ void Resource::incRef() void Resource::decRef() { // Reference may not already have reached zero - if (mRefCount == 0) - logger->error(strprintf("mRefCount may not be zero for %s", mIdPath.c_str())); + if (mRefCount == 0) { + logger->log("Warning: mRefCount already zero for %s", mIdPath.c_str()); + assert(false); + } mRefCount--; |