aboutsummaryrefslogtreecommitdiffstats
path: root/interface
diff options
context:
space:
mode:
Diffstat (limited to 'interface')
-rw-r--r--interface/type_depository.hpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/interface/type_depository.hpp b/interface/type_depository.hpp
index d0e0bfb..9bacc9b 100644
--- a/interface/type_depository.hpp
+++ b/interface/type_depository.hpp
@@ -53,7 +53,7 @@ namespace opt_utilities
~holder()
{
- delete ptr;
+ destroy();
}
holder& operator=(const holder& rhs)
@@ -62,7 +62,7 @@ namespace opt_utilities
{
return *this;
}
- delete ptr;
+ destroy();
ptr=rhs.ptr;
const_cast<holder&>(rhs).ptr=0;
}
@@ -77,7 +77,10 @@ namespace opt_utilities
void destroy()
{
- delete ptr;
+ if(ptr)
+ {
+ ptr->destroy();
+ }
}
T* get()const