summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/store.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/store.cc')
-rw-r--r--crawl-ref/source/store.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/crawl-ref/source/store.cc b/crawl-ref/source/store.cc
index 97d1e0a8c1..25c50ed763 100644
--- a/crawl-ref/source/store.cc
+++ b/crawl-ref/source/store.cc
@@ -1154,7 +1154,7 @@ CrawlHashTable::CrawlHashTable(const CrawlHashTable& other)
CrawlHashTable::~CrawlHashTable()
{
- // NOTE: Not using std::auto_ptr because making hash_map and auto_ptr
+ // NOTE: Not using std::auto_ptr because making hash_map an auto_ptr
// causes compile weirdness in externs.h
if (hash_map == NULL)
return;
@@ -1165,6 +1165,9 @@ CrawlHashTable::~CrawlHashTable()
CrawlHashTable &CrawlHashTable::operator = (const CrawlHashTable &other)
{
+ if (hash_map != NULL)
+ delete hash_map;
+
if (other.hash_map == NULL)
{
hash_map = NULL;