From: eap Date: Mon, 24 Dec 2012 12:47:59 +0000 (+0000) Subject: 0021948]: EDF SMESH : Memory is not freed when deleting a mesh X-Git-Tag: V6_main_FINAL~81 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a278dce53300533c2eefd71d538c690184ca0946;p=modules%2Fgeom.git 0021948]: EDF SMESH : Memory is not freed when deleting a mesh Move declaration of GEOM::GEOM_Object_wrap form GEOMBase/GEOM_GenericObjPtr.h to GEOM_I/GEOM_wrap.hxx as GEOMBase is a part of GUI + GEOM_wrap.hxx --- diff --git a/src/GEOM_I/GEOM_wrap.hxx b/src/GEOM_I/GEOM_wrap.hxx new file mode 100644 index 000000000..71fbbf773 --- /dev/null +++ b/src/GEOM_I/GEOM_wrap.hxx @@ -0,0 +1,59 @@ +// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// File : GEOM_wrap.hxx +// Created : Mon Dec 24 14:39:49 2012 +// Author : Edward AGAPOV (eap) + + +#ifndef __GEOM_wrap_HXX__ +#define __GEOM_wrap_HXX__ + +#include + +namespace GEOM +{ + // Declare a type GEOM::GEOM_Object_wrap to replace GEOM::GEOM_Object_var, + // to be used in the case if a new GEOM_Object is received, in which case + // obj->UnRegister() must be called to avoid a memory leak. + // The GEOM::GEOM_Object_wrap object calls UnRegister() at destruction. + // A simple rule: use GEOM::GEOM_Object_wrap if an object is returned by a + // GEOM operation (GEOM::GEOM_IBasicOperations etc). + // + typedef SALOME::GenericObj_wrap< GEOM_Object > GEOM_Object_wrap; + // + // wrappers of operations + typedef SALOME::GenericObj_wrap< GEOM_IBasicOperations > GEOM_IBasicOperations_wrap; + typedef SALOME::GenericObj_wrap< GEOM_ITransformOperations> GEOM_ITransformOperations_wrap; + typedef SALOME::GenericObj_wrap< GEOM_I3DPrimOperations > GEOM_I3DPrimOperations_wrap; + typedef SALOME::GenericObj_wrap< GEOM_IShapesOperations > GEOM_IShapesOperations_wrap; + typedef SALOME::GenericObj_wrap< GEOM_IBlocksOperations > GEOM_IBlocksOperations_wrap; + typedef SALOME::GenericObj_wrap< GEOM_IBooleanOperations > GEOM_IBooleanOperations_wrap; + typedef SALOME::GenericObj_wrap< GEOM_ICurvesOperations > GEOM_ICurvesOperations_wrap; + typedef SALOME::GenericObj_wrap< GEOM_ILocalOperations > GEOM_ILocalOperations_wrap; + typedef SALOME::GenericObj_wrap< GEOM_IHealingOperations > GEOM_IHealingOperations_wrap; + typedef SALOME::GenericObj_wrap< GEOM_IInsertOperations > GEOM_IInsertOperations_wrap; + typedef SALOME::GenericObj_wrap< GEOM_IMeasureOperations > GEOM_IMeasureOperations_wrap; + typedef SALOME::GenericObj_wrap< GEOM_IGroupOperations > GEOM_IGroupOperations_wrap; + typedef SALOME::GenericObj_wrap< GEOM_IAdvancedOperations > GEOM_IAdvancedOperations_wrap; +} + +#endif diff --git a/src/GEOM_I/Makefile.am b/src/GEOM_I/Makefile.am index e4581b71d..16383a10c 100644 --- a/src/GEOM_I/Makefile.am +++ b/src/GEOM_I/Makefile.am @@ -46,7 +46,8 @@ salomeinclude_HEADERS = \ GEOM_IGroupOperations_i.hh \ GEOM_IAdvancedOperations_i.hh \ GEOM_Gen_i.hh \ - GEOM_GEOM_I.hxx + GEOM_GEOM_I.hxx \ + GEOM_wrap.hxx dist_libGEOMEngine_la_SOURCES = \ GEOM_Object_i.cc \