Salome HOME
projects
/
modules
/
shaper.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Issue #2059 point in sketch is created not on selected line of external sketchPlane...
[modules/shaper.git]
/
src
/
GeomAPI
/
GeomAPI_Interface.h
diff --git
a/src/GeomAPI/GeomAPI_Interface.h
b/src/GeomAPI/GeomAPI_Interface.h
index de51617ae7e8b45b861e1f59d95db2fd72d21a7c..27b8220129d590ed378e3f818b0f6c8932446c18 100644
(file)
--- 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
*/
* \brief General base class for all interfaces in this package
*/
+template <typename T>
+void GeomAPI_deleter( void* p ) {
+ delete reinterpret_cast<T*>(p);
+}
+
class GeomAPI_Interface
{
private:
class GeomAPI_Interface
{
private:
@@
-28,7
+33,7
@@
class GeomAPI_Interface
/// Constructor by the impl pointer (used for internal needs)
template<class T> explicit GeomAPI_Interface(T* theImpl)
{
/// Constructor by the impl pointer (used for internal needs)
template<class T> explicit GeomAPI_Interface(T* theImpl)
{
- myImpl
.reset(reinterpret_cast<char*>(theImpl)
);
+ myImpl
= std::shared_ptr<char>(reinterpret_cast<char*>(theImpl), GeomAPI_deleter<T>
);
}
/// Destructor
}
/// Destructor
@@
-52,7
+57,7
@@
class GeomAPI_Interface
/// Updates the impl (deletes the old one)
template<class T> inline void setImpl(T* theImpl)
{
/// Updates the impl (deletes the old one)
template<class T> inline void setImpl(T* theImpl)
{
- myImpl
.reset(reinterpret_cast<char*>(theImpl)
);
+ myImpl
= std::shared_ptr<char>(reinterpret_cast<char*>(theImpl), GeomAPI_deleter<T>
);
}
/// Returns true if the impl is empty
}
/// Returns true if the impl is empty