diff options
author | Tim King <taking@google.com> | 2015-12-04 15:58:19 -0800 |
---|---|---|
committer | Tim King <taking@google.com> | 2015-12-15 14:54:52 -0800 |
commit | c358ccba3bf54a85ed9503b636c1f0bab381bc05 (patch) | |
tree | 9148456ab5193f66b4dbe0813f9b674952b50b04 /src/context/cdhashmap.h | |
parent | b812decc8428d0873ac860b79c7ee5bf003bf09e (diff) |
Adding destructors for CDO an CDOhash_map in the restore() functions.
Diffstat (limited to 'src/context/cdhashmap.h')
-rw-r--r-- | src/context/cdhashmap.h | 6 |
1 files changed, 5 insertions, 1 deletions
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<CDOhash_map*>(data); if(d_map != NULL) { - CDOhash_map* p = static_cast<CDOhash_map*>(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 */ |