diff options
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: |