From 65cfe455aae323a274ef6e504e7c452076039bbc Mon Sep 17 00:00:00 2001 From: astrojhgu Date: Sun, 1 May 2011 17:03:12 +0000 Subject: git-svn-id: file:///home/svn/opt_utilities@191 ed2142bd-67ad-457f-ba7c-d818d4011675 --- interface/type_depository.hpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'interface') 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(rhs).ptr=0; } @@ -77,7 +77,10 @@ namespace opt_utilities void destroy() { - delete ptr; + if(ptr) + { + ptr->destroy(); + } } T* get()const -- cgit v1.2.2