diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2007-12-22 21:33:47 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2007-12-22 21:33:47 +0000 |
commit | 8d3e43a7510dd7367c3bb62aae6841836f727493 (patch) | |
tree | c644328d6ec98f37252efa063cb720bd71eec2f5 /src/resources/resource.cpp | |
parent | aed1ad6210fa1ed0a70da5d87082cedff0bd516a (diff) | |
download | mana-8d3e43a7510dd7367c3bb62aae6841836f727493.tar.gz mana-8d3e43a7510dd7367c3bb62aae6841836f727493.tar.bz2 mana-8d3e43a7510dd7367c3bb62aae6841836f727493.tar.xz mana-8d3e43a7510dd7367c3bb62aae6841836f727493.zip |
Merged revisions 3740 via svnmerge from
https://themanaworld.svn.sourceforge.net/svnroot/themanaworld/tmw/trunk
........
r3740 | gmelquio | 2007-11-16 12:06:46 +0100 (vr, 16 nov 2007) | 1 line
Delayed resource deletion by 30 seconds.
........
Diffstat (limited to 'src/resources/resource.cpp')
-rw-r--r-- | src/resources/resource.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/resources/resource.cpp b/src/resources/resource.cpp index 07f31b8f..8f21f5d2 100644 --- a/src/resources/resource.cpp +++ b/src/resources/resource.cpp @@ -21,10 +21,10 @@ * $Id$ */ -#include "resource.h" - #include <cassert> +#include "resource.h" + #include "resourcemanager.h" Resource::~Resource() @@ -45,10 +45,10 @@ Resource::decRef() mRefCount--; - if (mRefCount == 0) { - // Make sure resource manager won't refer to deleted resource + if (mRefCount == 0) + { + // Warn the manager that this resource is no longer used. ResourceManager *resman = ResourceManager::getInstance(); - resman->release(mIdPath); - delete this; + resman->release(this); } } |