From c358ccba3bf54a85ed9503b636c1f0bab381bc05 Mon Sep 17 00:00:00 2001 From: Tim King Date: Fri, 4 Dec 2015 15:58:19 -0800 Subject: Adding destructors for CDO an CDOhash_map in the restore() functions. --- src/context/cdhashmap.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/context/cdhashmap.h') diff --git a/src/context/cdhashmap.h b/src/context/cdhashmap.h index 51fd3b411..0eb1d03c9 100644 --- a/src/context/cdhashmap.h +++ b/src/context/cdhashmap.h @@ -128,8 +128,8 @@ class CDOhash_map : public ContextObj { } virtual void restore(ContextObj* data) { + CDOhash_map* p = static_cast(data); if(d_map != NULL) { - CDOhash_map* p = static_cast(data); if(p->d_map == NULL) { Assert(d_map->d_map.find(d_key) != d_map->d_map.end() && (*d_map->d_map.find(d_key)).second == this); @@ -163,6 +163,10 @@ class CDOhash_map : public ContextObj { d_data = p->d_data; } } + // Explicitly call destructors fro the key and the date as they will not + // otherwise get called. + p->d_key.~Key(); + p->d_data.~Data(); } /** ensure copy ctor is only called by us */ -- cgit v1.2.3