From e216a7bb8d7ee5d20dad462e6b0bdb67a15f056e Mon Sep 17 00:00:00 2001 From: sbh Date: Tue, 3 Mar 2015 15:03:08 +0300 Subject: [PATCH] Explicit inclusion of NewGEOM and STL headers in SWIG to avoid memory leaks. --- src/GeomAPI/GeomAPI.i | 3 +++ src/GeomAlgoAPI/GeomAlgoAPI.i | 4 ++++ src/GeomDataAPI/GeomDataAPI.i | 4 ++++ src/ModelAPI/ModelAPI.i | 11 ++++------- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/GeomAPI/GeomAPI.i b/src/GeomAPI/GeomAPI.i index 99ff18f02..25c752b61 100644 --- a/src/GeomAPI/GeomAPI.i +++ b/src/GeomAPI/GeomAPI.i @@ -21,6 +21,9 @@ #include "GeomAPI_Pnt.h" #include "GeomAPI_XY.h" #include "GeomAPI_XYZ.h" + + #include + #include %} // to avoid error on this diff --git a/src/GeomAlgoAPI/GeomAlgoAPI.i b/src/GeomAlgoAPI/GeomAlgoAPI.i index 4a1b94eda..18d82cbcf 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI.i +++ b/src/GeomAlgoAPI/GeomAlgoAPI.i @@ -11,6 +11,10 @@ #include "GeomAlgoAPI_MakeShape.h" #include "GeomAlgoAPI_PointBuilder.h" #include "GeomAlgoAPI_SketchBuilder.h" + + #include + #include + #include %} // to avoid error on this diff --git a/src/GeomDataAPI/GeomDataAPI.i b/src/GeomDataAPI/GeomDataAPI.i index 98496183e..24da73652 100644 --- a/src/GeomDataAPI/GeomDataAPI.i +++ b/src/GeomDataAPI/GeomDataAPI.i @@ -6,6 +6,10 @@ #include "GeomDataAPI_Point.h" #include "GeomDataAPI_Dir.h" #include "GeomDataAPI_Point2D.h" + + #include + #include + #include template std::shared_ptr castTo(std::shared_ptr theObject) { diff --git a/src/ModelAPI/ModelAPI.i b/src/ModelAPI/ModelAPI.i index ff4b9e7ad..77a0f42e0 100644 --- a/src/ModelAPI/ModelAPI.i +++ b/src/ModelAPI/ModelAPI.i @@ -9,8 +9,6 @@ } %{ - #include "GeomAPI_Interface.h" - #include "GeomAPI_Shape.h" #include "ModelAPI.h" #include "ModelAPI_Document.h" #include "ModelAPI_Session.h" @@ -40,6 +38,9 @@ #include "ModelAPI_ResultParameters.h" #include "ModelAPI_ResultGroup.h" #include "ModelAPI_Tools.h" + + #include + #include template std::shared_ptr shared_ptr_cast(std::shared_ptr theObject) @@ -51,10 +52,10 @@ // to avoid error on this #define MODELAPI_EXPORT -#define GEOMAPI_EXPORT // standard definitions %include "typemaps.i" +%include "GeomAPI.i" %include "std_string.i" %include "std_list.i" %include "std_shared_ptr.i" @@ -68,8 +69,6 @@ // shared pointers // For ModelAPI_ResultConstruction.shape() -%shared_ptr(GeomAPI_Interface) -%shared_ptr(GeomAPI_Shape) %shared_ptr(ModelAPI_Document) %shared_ptr(ModelAPI_Session) %shared_ptr(ModelAPI_Plugin) @@ -99,8 +98,6 @@ %shared_ptr(ModelAPI_ResultParameters) // all supported interfaces -%include "GeomAPI_Interface.h" -%include "GeomAPI_Shape.h" %include "ModelAPI_Document.h" %include "ModelAPI_Session.h" %include "ModelAPI_Plugin.h" -- 2.39.2