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/cdo.h | |
parent | b812decc8428d0873ac860b79c7ee5bf003bf09e (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.h | 5 |
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: |