From: spo Date: Wed, 25 May 2016 07:47:08 +0000 (+0300) Subject: Fix memory leak with shared_ptr in HighModelAPI and ConstructionAPI X-Git-Tag: V_2.4.0~91^2~101 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2620ddc6d39c8e339ae28ce2bf3e1611e31f06cb;p=modules%2Fshaper.git Fix memory leak with shared_ptr in HighModelAPI and ConstructionAPI --- diff --git a/src/ConstructionAPI/ConstructionAPI.i b/src/ConstructionAPI/ConstructionAPI.i index 5d9a79484..ed3c2172a 100644 --- a/src/ConstructionAPI/ConstructionAPI.i +++ b/src/ConstructionAPI/ConstructionAPI.i @@ -12,6 +12,10 @@ // standard definitions %include "typemaps.i" +%include "std_shared_ptr.i" + +// shared pointers +%shared_ptr(ConstructionAPI_Point) // all supported interfaces %include "ConstructionAPI_Point.h" diff --git a/src/ModelHighAPI/ModelHighAPI.i b/src/ModelHighAPI/ModelHighAPI.i index 413ba1a94..5c6369cb5 100644 --- a/src/ModelHighAPI/ModelHighAPI.i +++ b/src/ModelHighAPI/ModelHighAPI.i @@ -10,9 +10,10 @@ // standard definitions %include "typemaps.i" %include "std_string.i" +%include "std_shared_ptr.i" -// all supported interfaces -%include "ModelHighAPI_Double.h" +// shared pointers +%shared_ptr(ModelHighAPI_Interface) // typemaps %typemap(in) const ModelHighAPI_Double & (ModelHighAPI_Double temp) { @@ -32,3 +33,7 @@ %typecheck(SWIG_TYPECHECK_POINTER) ModelHighAPI_Double, const ModelHighAPI_Double & { $1 = (PyFloat_Check($input) || PyInt_Check($input) || PyLong_Check($input) || PyString_Check($input)) ? 1 : 0; } + +// all supported interfaces +%include "ModelHighAPI_Double.h" +%include "ModelHighAPI_Interface.h" diff --git a/src/ModelHighAPI/ModelHighAPI_swig.h b/src/ModelHighAPI/ModelHighAPI_swig.h index f5a8471c9..d4cf88b65 100644 --- a/src/ModelHighAPI/ModelHighAPI_swig.h +++ b/src/ModelHighAPI/ModelHighAPI_swig.h @@ -11,5 +11,6 @@ #include "ModelHighAPI.h" #include "ModelHighAPI_Double.h" + #include "ModelHighAPI_Interface.h" #endif /* SRC_MODELHIGHAPI_MODELHIGHAPI_SWIG_H_ */