diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-05-17 00:36:02 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-05-17 00:36:02 +0000 |
commit | 84fd76cd43e2d7c8e647e78eabc47279cfade973 (patch) | |
tree | 110d1324c34b4bfdaaad96cea04d28be1b1a3c02 /src/resources | |
parent | 165b87d22f6710003868e32ed52645447be5d538 (diff) | |
download | mana-84fd76cd43e2d7c8e647e78eabc47279cfade973.tar.gz mana-84fd76cd43e2d7c8e647e78eabc47279cfade973.tar.bz2 mana-84fd76cd43e2d7c8e647e78eabc47279cfade973.tar.xz mana-84fd76cd43e2d7c8e647e78eabc47279cfade973.zip |
Temporarily fixing problem with resource cleanup.
Diffstat (limited to 'src/resources')
-rw-r--r-- | src/resources/resource.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/resources/resource.cpp b/src/resources/resource.cpp index a1e5c1dc..ad76f266 100644 --- a/src/resources/resource.cpp +++ b/src/resources/resource.cpp @@ -35,7 +35,7 @@ bool Resource::isLoaded() const void Resource::incRef() { - ++referenceCount; + referenceCount++; } bool Resource::decRef() @@ -46,12 +46,20 @@ bool Resource::decRef() * this function until that is solved. Probably we'll have to make it * so that decrementing count goes through resource manager too. */ - --referenceCount; + if (referenceCount > 0) + { + referenceCount--; - if (!referenceCount) { - //delete this; + if (referenceCount == 0) { + //delete this; + return true; + } + else { + return false; + } + } + else { + // Warning: Shouldn't get here! return true; } - - return false; } |