X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAPI%2FGeomAPI_Interface.h;h=27b8220129d590ed378e3f818b0f6c8932446c18;hb=124fc0a11b2b9d601b73b9a60f3541e8b47b910b;hp=de51617ae7e8b45b861e1f59d95db2fd72d21a7c;hpb=a562cdee56c48ee1395f5a169eba8dcbe5d29088;p=modules%2Fshaper.git diff --git a/src/GeomAPI/GeomAPI_Interface.h b/src/GeomAPI/GeomAPI_Interface.h index de51617ae..27b822012 100644 --- a/src/GeomAPI/GeomAPI_Interface.h +++ b/src/GeomAPI/GeomAPI_Interface.h @@ -16,6 +16,11 @@ * \brief General base class for all interfaces in this package */ +template +void GeomAPI_deleter( void* p ) { + delete reinterpret_cast(p); +} + class GeomAPI_Interface { private: @@ -28,7 +33,7 @@ class GeomAPI_Interface /// Constructor by the impl pointer (used for internal needs) template explicit GeomAPI_Interface(T* theImpl) { - myImpl.reset(reinterpret_cast(theImpl)); + myImpl = std::shared_ptr(reinterpret_cast(theImpl), GeomAPI_deleter); } /// Destructor @@ -52,7 +57,7 @@ class GeomAPI_Interface /// Updates the impl (deletes the old one) template inline void setImpl(T* theImpl) { - myImpl.reset(reinterpret_cast(theImpl)); + myImpl = std::shared_ptr(reinterpret_cast(theImpl), GeomAPI_deleter); } /// Returns true if the impl is empty