diff options
author | Max Horn | 2007-03-12 22:34:29 +0000 |
---|---|---|
committer | Max Horn | 2007-03-12 22:34:29 +0000 |
commit | 30e975f9db056cd58728ebdc79689e41eb27f1d1 (patch) | |
tree | 1647771a0a356808f9d10aafcfd85ef2b8298c78 /common/hashmap.h | |
parent | 689ea77c0d8be927d2d5c9874239e444267a4999 (diff) | |
download | scummvm-rg350-30e975f9db056cd58728ebdc79689e41eb27f1d1.tar.gz scummvm-rg350-30e975f9db056cd58728ebdc79689e41eb27f1d1.tar.bz2 scummvm-rg350-30e975f9db056cd58728ebdc79689e41eb27f1d1.zip |
Protect Array<> and HashMap<> instances against self assignments
svn-id: r26115
Diffstat (limited to 'common/hashmap.h')
-rw-r--r-- | common/hashmap.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/common/hashmap.h b/common/hashmap.h index b5b2bb922b..982e3df70f 100644 --- a/common/hashmap.h +++ b/common/hashmap.h @@ -155,6 +155,9 @@ public: ~HashMap(); HM_t &operator =(const HM_t &map) { + if (this == &map) + return *this; + // Remove the previous content and ... clear(); delete[] _arr; |