summaryrefslogtreecommitdiff
path: root/src/context/cdo.h
diff options
context:
space:
mode:
authorTim King <taking@google.com>2015-12-04 15:58:19 -0800
committerTim King <taking@google.com>2015-12-15 14:54:52 -0800
commitc358ccba3bf54a85ed9503b636c1f0bab381bc05 (patch)
tree9148456ab5193f66b4dbe0813f9b674952b50b04 /src/context/cdo.h
parentb812decc8428d0873ac860b79c7ee5bf003bf09e (diff)
Adding destructors for CDO an CDOhash_map in the restore() functions.
Diffstat (limited to 'src/context/cdo.h')
-rw-r--r--src/context/cdo.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/context/cdo.h b/src/context/cdo.h
index 486626ae5..860648b27 100644
--- a/src/context/cdo.h
+++ b/src/context/cdo.h
@@ -70,8 +70,11 @@ protected:
*/
virtual void restore(ContextObj* pContextObj) {
//Debug("context") << "restore cdo " << this;
- d_data = ((CDO<T>*) pContextObj)->d_data;
+ CDO<T>* p = static_cast<CDO<T>*>(pContextObj);
+ d_data = p->d_data;
//Debug("context") << " to " << get() << std::endl;
+ // Explicitly call destructor as it will not otherwise get called.
+ p->d_data.~T();
}
public:
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback