summaryrefslogtreecommitdiff
path: root/src/context/cdo.h
diff options
context:
space:
mode:
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