Regression of SMESH_SRC/doc/salome/examples/measurements_ex01.py

Do not store temporary SMESH_IDSource created by MakeIDSource()
This commit is contained in:
eap 2013-08-07 14:05:44 +00:00
parent 6825861aab
commit f3ae24b365
2 changed files with 20 additions and 17 deletions

View File

@ -63,6 +63,7 @@
#include <Utils_ExceptHandlers.hxx> #include <Utils_ExceptHandlers.hxx>
#include <Utils_CorbaException.hxx> #include <Utils_CorbaException.hxx>
#include <SALOMEDS_wrap.hxx> #include <SALOMEDS_wrap.hxx>
#include <SALOME_GenericObj_i.hh>
#include <BRepAdaptor_Surface.hxx> #include <BRepAdaptor_Surface.hxx>
#include <BRep_Tool.hxx> #include <BRep_Tool.hxx>
@ -453,7 +454,7 @@ SMESH_MeshEditor_i::SMESH_MeshEditor_i(SMESH_Mesh_i* theMesh, bool isPreview):
SMESH_MeshEditor_i::~SMESH_MeshEditor_i() SMESH_MeshEditor_i::~SMESH_MeshEditor_i()
{ {
deleteAuxIDSources(); //deleteAuxIDSources();
delete myPreviewMesh; myPreviewMesh = 0; delete myPreviewMesh; myPreviewMesh = 0;
delete myPreviewEditor; myPreviewEditor = 0; delete myPreviewEditor; myPreviewEditor = 0;
} }
@ -711,10 +712,12 @@ SMESH::ComputeError* SMESH_MeshEditor_i::GetLastError()
//======================================================================= //=======================================================================
//function : MakeIDSource //function : MakeIDSource
//purpose : Wrap a sequence of ids in a SMESH_IDSource //purpose : Wrap a sequence of ids in a SMESH_IDSource.
// Call UnRegister() as you fininsh using it!!
//======================================================================= //=======================================================================
struct SMESH_MeshEditor_i::_IDSource : public POA_SMESH::SMESH_IDSource struct SMESH_MeshEditor_i::_IDSource : public virtual POA_SMESH::SMESH_IDSource,
public virtual SALOME::GenericObj_i
{ {
SMESH::long_array _ids; SMESH::long_array _ids;
SMESH::ElementType _type; SMESH::ElementType _type;
@ -745,16 +748,16 @@ struct SMESH_MeshEditor_i::_IDSource : public POA_SMESH::SMESH_IDSource
SMESH::SMESH_IDSource_ptr SMESH_MeshEditor_i::MakeIDSource(const SMESH::long_array& ids, SMESH::SMESH_IDSource_ptr SMESH_MeshEditor_i::MakeIDSource(const SMESH::long_array& ids,
SMESH::ElementType type) SMESH::ElementType type)
{ {
if ( myAuxIDSources.size() > 10 ) { // if ( myAuxIDSources.size() > 10 ) {
delete myAuxIDSources.front(); // delete myAuxIDSources.front();
myAuxIDSources.pop_front(); // myAuxIDSources.pop_front();
} // }
_IDSource* idSrc = new _IDSource; _IDSource* idSrc = new _IDSource;
idSrc->_mesh = myMesh_i->_this(); idSrc->_mesh = myMesh_i->_this();
idSrc->_ids = ids; idSrc->_ids = ids;
idSrc->_type = type; idSrc->_type = type;
myAuxIDSources.push_back( idSrc ); //myAuxIDSources.push_back( idSrc );
SMESH::SMESH_IDSource_var anIDSourceVar = idSrc->_this(); SMESH::SMESH_IDSource_var anIDSourceVar = idSrc->_this();
@ -778,13 +781,13 @@ CORBA::Long* SMESH_MeshEditor_i::GetTemporaryIDs( SMESH::SMESH_IDSource_ptr& idS
return 0; return 0;
} }
void SMESH_MeshEditor_i::deleteAuxIDSources() // void SMESH_MeshEditor_i::deleteAuxIDSources()
{ // {
std::list< _IDSource* >::iterator idSrcIt = myAuxIDSources.begin(); // std::list< _IDSource* >::iterator idSrcIt = myAuxIDSources.begin();
for ( ; idSrcIt != myAuxIDSources.end(); ++idSrcIt ) // for ( ; idSrcIt != myAuxIDSources.end(); ++idSrcIt )
delete *idSrcIt; // delete *idSrcIt;
myAuxIDSources.clear(); // myAuxIDSources.clear();
} // }
//============================================================================= //=============================================================================
/*! /*!

View File

@ -1097,8 +1097,8 @@ private: //!< fields
// temporary IDSources // temporary IDSources
struct _IDSource; struct _IDSource;
std::list< _IDSource* > myAuxIDSources; // std::list< _IDSource* > myAuxIDSources;
void deleteAuxIDSources(); // void deleteAuxIDSources();
}; };
#endif #endif