Fix memory leaks

This commit is contained in:
vsr 2009-09-21 13:01:41 +00:00
parent d068bb8b46
commit 47d4ddf2b2
6 changed files with 15 additions and 26 deletions

View File

@ -230,9 +230,8 @@ bool BuildGUI_CompoundDlg::isValid( QString& )
//================================================================================= //=================================================================================
bool BuildGUI_CompoundDlg::execute( ObjectList& objects ) bool BuildGUI_CompoundDlg::execute( ObjectList& objects )
{ {
GEOM::GEOM_Object_var anObj; GEOM::GEOM_IShapesOperations_var anOper = GEOM::GEOM_IShapesOperations::_narrow( getOperation() );
GEOM::GEOM_Object_var anObj = anOper->MakeCompound( myShapes );
anObj = GEOM::GEOM_IShapesOperations::_narrow( getOperation() )->MakeCompound( myShapes );
if ( !anObj->_is_nil() ) if ( !anObj->_is_nil() )
objects.push_back( anObj._retn() ); objects.push_back( anObj._retn() );

View File

@ -293,9 +293,8 @@ bool BuildGUI_EdgeDlg::isValid (QString&)
//================================================================================= //=================================================================================
bool BuildGUI_EdgeDlg::execute (ObjectList& objects) bool BuildGUI_EdgeDlg::execute (ObjectList& objects)
{ {
GEOM::GEOM_Object_var anObj; GEOM::GEOM_IShapesOperations_var anOper = GEOM::GEOM_IShapesOperations::_narrow( getOperation() );
GEOM::GEOM_Object_var anObj = anOper->MakeEdge(myPoint1, myPoint2);
anObj = GEOM::GEOM_IShapesOperations::_narrow(getOperation())->MakeEdge(myPoint1, myPoint2);
if (!anObj->_is_nil()) if (!anObj->_is_nil())
objects.push_back(anObj._retn()); objects.push_back(anObj._retn());

View File

@ -245,11 +245,8 @@ bool BuildGUI_FaceDlg::isValid( QString& )
//================================================================================= //=================================================================================
bool BuildGUI_FaceDlg::execute( ObjectList& objects ) bool BuildGUI_FaceDlg::execute( ObjectList& objects )
{ {
GEOM::GEOM_Object_var anObj; GEOM::GEOM_IShapesOperations_var anOper = GEOM::GEOM_IShapesOperations::_narrow( getOperation() );
GEOM::GEOM_Object_var anObj = anOper->MakeFaceWires( myWires, GroupWire->CheckButton1->isChecked() );
bool isPlanarWanted = GroupWire->CheckButton1->isChecked();
anObj = GEOM::GEOM_IShapesOperations::_narrow(
getOperation() )->MakeFaceWires( myWires, isPlanarWanted );
if ( !anObj->_is_nil() ) if ( !anObj->_is_nil() )
objects.push_back( anObj._retn() ); objects.push_back( anObj._retn() );

View File

@ -259,10 +259,8 @@ bool BuildGUI_ShellDlg::isValid( QString& )
//================================================================================= //=================================================================================
bool BuildGUI_ShellDlg::execute( ObjectList& objects ) bool BuildGUI_ShellDlg::execute( ObjectList& objects )
{ {
GEOM::GEOM_Object_var anObj; GEOM::GEOM_IShapesOperations_var anOper = GEOM::GEOM_IShapesOperations::_narrow( getOperation() );
GEOM::GEOM_Object_var anObj = anOper->MakeShell( myFacesAndShells );
anObj = GEOM::GEOM_IShapesOperations::_narrow(
getOperation() )->MakeShell( myFacesAndShells );
if ( !anObj->_is_nil() ) if ( !anObj->_is_nil() )
objects.push_back( anObj._retn() ); objects.push_back( anObj._retn() );

View File

@ -267,9 +267,7 @@ bool BuildGUI_SolidDlg::isClosed(int i)
return false; return false;
} }
GEOM::GEOM_IMeasureOperations_ptr anOp = myGeomGUI->GetGeomGen()->GetIMeasureOperations( getStudyId() ); GEOM::GEOM_IMeasureOperations_var anOp = myGeomGUI->GetGeomGen()->GetIMeasureOperations( getStudyId() );
// GEOM::GEOM_IMeasureOperations_var anOp = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() );
// Detect kind of shape and parameters // Detect kind of shape and parameters
aKind = anOp->KindOfShape(aShape, anInts, aDbls); aKind = anOp->KindOfShape(aShape, anInts, aDbls);
@ -295,17 +293,17 @@ bool BuildGUI_SolidDlg::execute( ObjectList& objects )
{ {
bool toCreateSingleSolid = GroupSolid->CheckButton1->isChecked(); bool toCreateSingleSolid = GroupSolid->CheckButton1->isChecked();
GEOM::GEOM_IShapesOperations_var anOper = GEOM::GEOM_IShapesOperations::_narrow( getOperation() );
if ( toCreateSingleSolid ) { if ( toCreateSingleSolid ) {
GEOM::GEOM_Object_var anObj = GEOM::GEOM_IShapesOperations::_narrow( GEOM::GEOM_Object_var anObj = anOper->MakeSolidShells( myShells );
getOperation() )->MakeSolidShells( myShells );
if ( !anObj->_is_nil() ) if ( !anObj->_is_nil() )
objects.push_back( anObj._retn() ); objects.push_back( anObj._retn() );
} }
else { else {
for ( int i = 0, n = myShells.length(); i< n; i++ ) { for ( int i = 0, n = myShells.length(); i< n; i++ ) {
GEOM::GEOM_Object_var anObj = GEOM::GEOM_IShapesOperations::_narrow( GEOM::GEOM_Object_var anObj = anOper->MakeSolidShell( myShells[ i ] );
getOperation() )->MakeSolidShell( myShells[ i ] );
if ( !anObj->_is_nil() ) if ( !anObj->_is_nil() )
objects.push_back( anObj._retn() ); objects.push_back( anObj._retn() );

View File

@ -252,10 +252,8 @@ bool BuildGUI_WireDlg::isValid (QString& msg)
//================================================================================= //=================================================================================
bool BuildGUI_WireDlg::execute (ObjectList& objects) bool BuildGUI_WireDlg::execute (ObjectList& objects)
{ {
GEOM::GEOM_Object_var anObj; GEOM::GEOM_IShapesOperations_var anOper = GEOM::GEOM_IShapesOperations::_narrow( getOperation() );
GEOM::GEOM_Object_var anObj = anOper->MakeWire(myEdgesAndWires, GroupArgs->SpinBox_DX->value());
anObj = GEOM::GEOM_IShapesOperations::_narrow(getOperation())->
MakeWire(myEdgesAndWires, GroupArgs->SpinBox_DX->value());
if (!anObj->_is_nil()) if (!anObj->_is_nil())
objects.push_back(anObj._retn()); objects.push_back(anObj._retn());