aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorMax Horn2008-03-26 19:29:33 +0000
committerMax Horn2008-03-26 19:29:33 +0000
commitb0c6a12c81c949c7f61b6639b509dad2b4fbb862 (patch)
treea20a4c62707dee6bad3a45fc2b3409d86c7377ce /common
parentafed582280195bc0165e93af7003aadea6438c89 (diff)
downloadscummvm-rg350-b0c6a12c81c949c7f61b6639b509dad2b4fbb862.tar.gz
scummvm-rg350-b0c6a12c81c949c7f61b6639b509dad2b4fbb862.tar.bz2
scummvm-rg350-b0c6a12c81c949c7f61b6639b509dad2b4fbb862.zip
Modified Patch #1925352: Memory leak fixes
svn-id: r31244
Diffstat (limited to 'common')
-rw-r--r--common/singleton.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/common/singleton.h b/common/singleton.h
index 56039afb37..849bf208bb 100644
--- a/common/singleton.h
+++ b/common/singleton.h
@@ -71,6 +71,10 @@ public:
_singleton = T::makeInstance();
return *_singleton;
}
+ virtual void destroy() {
+ delete _singleton;
+ _singleton = 0;
+ }
protected:
Singleton<T>() { }
#ifdef __SYMBIAN32__