]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
Fix memory leaks
authorvsr <vsr@opencascade.com>
Mon, 21 Sep 2009 13:01:41 +0000 (13:01 +0000)
committervsr <vsr@opencascade.com>
Mon, 21 Sep 2009 13:01:41 +0000 (13:01 +0000)
src/BuildGUI/BuildGUI_CompoundDlg.cxx
src/BuildGUI/BuildGUI_EdgeDlg.cxx
src/BuildGUI/BuildGUI_FaceDlg.cxx
src/BuildGUI/BuildGUI_ShellDlg.cxx
src/BuildGUI/BuildGUI_SolidDlg.cxx
src/BuildGUI/BuildGUI_WireDlg.cxx

index 2a25fa2aca277c89e53bc9a5514152b7641a21f3..a839123b195fa057a2a4147a2a7c12268efffcc5 100644 (file)
@@ -230,9 +230,8 @@ bool BuildGUI_CompoundDlg::isValid( QString& )
 //=================================================================================
 bool BuildGUI_CompoundDlg::execute( ObjectList& objects )
 {
-  GEOM::GEOM_Object_var anObj;
-
-  anObj = GEOM::GEOM_IShapesOperations::_narrow( getOperation() )->MakeCompound( myShapes );
+  GEOM::GEOM_IShapesOperations_var anOper = GEOM::GEOM_IShapesOperations::_narrow( getOperation() );
+  GEOM::GEOM_Object_var anObj = anOper->MakeCompound( myShapes );
 
   if ( !anObj->_is_nil() )
     objects.push_back( anObj._retn() );
index 1548635f45a908cce1bbbedd783e08615589f554..ceee5f69a981458157ea59213841276bf652097c 100644 (file)
@@ -293,9 +293,8 @@ bool BuildGUI_EdgeDlg::isValid (QString&)
 //=================================================================================
 bool BuildGUI_EdgeDlg::execute (ObjectList& objects)
 {
-  GEOM::GEOM_Object_var anObj;
-
-  anObj = GEOM::GEOM_IShapesOperations::_narrow(getOperation())->MakeEdge(myPoint1, myPoint2);
+  GEOM::GEOM_IShapesOperations_var anOper = GEOM::GEOM_IShapesOperations::_narrow( getOperation() );
+  GEOM::GEOM_Object_var anObj = anOper->MakeEdge(myPoint1, myPoint2);
 
   if (!anObj->_is_nil())
     objects.push_back(anObj._retn());
index e1adb30c60e155ada891e93b7b09a65c77973890..c06a1fa15c8325625f3837cb205a091e15721dfc 100644 (file)
@@ -245,11 +245,8 @@ bool BuildGUI_FaceDlg::isValid( QString& )
 //=================================================================================
 bool BuildGUI_FaceDlg::execute( ObjectList& objects )
 {
-  GEOM::GEOM_Object_var anObj;
-
-  bool isPlanarWanted = GroupWire->CheckButton1->isChecked();
-  anObj = GEOM::GEOM_IShapesOperations::_narrow(
-    getOperation() )->MakeFaceWires( myWires, isPlanarWanted );
+  GEOM::GEOM_IShapesOperations_var anOper = GEOM::GEOM_IShapesOperations::_narrow( getOperation() );
+  GEOM::GEOM_Object_var anObj = anOper->MakeFaceWires( myWires, GroupWire->CheckButton1->isChecked() );
 
   if ( !anObj->_is_nil() )
     objects.push_back( anObj._retn() );
index bd1cb125ad7ac40e01989bb0e3ca8adf735114db..1e4b38a8f9fa1e4713e8e503adb80d456a7a466c 100644 (file)
@@ -259,10 +259,8 @@ bool BuildGUI_ShellDlg::isValid( QString& )
 //=================================================================================
 bool BuildGUI_ShellDlg::execute( ObjectList& objects )
 {
-  GEOM::GEOM_Object_var anObj;
-
-  anObj = GEOM::GEOM_IShapesOperations::_narrow(
-    getOperation() )->MakeShell( myFacesAndShells );
+  GEOM::GEOM_IShapesOperations_var anOper = GEOM::GEOM_IShapesOperations::_narrow( getOperation() );
+  GEOM::GEOM_Object_var anObj = anOper->MakeShell( myFacesAndShells );
 
   if ( !anObj->_is_nil() )
     objects.push_back( anObj._retn() );
index 05b62c1a21a92dfefe78eb5ce80fc4f9d0c15688..592fa436b08f8cb1d46ae0456648a5c9645cc849 100644 (file)
@@ -267,9 +267,7 @@ bool BuildGUI_SolidDlg::isClosed(int i)
     return false;
   }
 
-  GEOM::GEOM_IMeasureOperations_ptr anOp = myGeomGUI->GetGeomGen()->GetIMeasureOperations( getStudyId() );
-
-  //  GEOM::GEOM_IMeasureOperations_var anOp = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() );
+  GEOM::GEOM_IMeasureOperations_var anOp = myGeomGUI->GetGeomGen()->GetIMeasureOperations( getStudyId() );
 
   // Detect kind of shape and parameters
   aKind = anOp->KindOfShape(aShape, anInts, aDbls);
@@ -295,17 +293,17 @@ bool BuildGUI_SolidDlg::execute( ObjectList& objects )
 {
   bool toCreateSingleSolid = GroupSolid->CheckButton1->isChecked();
   
+  GEOM::GEOM_IShapesOperations_var anOper = GEOM::GEOM_IShapesOperations::_narrow( getOperation() );
+    
   if ( toCreateSingleSolid ) {
-    GEOM::GEOM_Object_var anObj = GEOM::GEOM_IShapesOperations::_narrow(
-      getOperation() )->MakeSolidShells( myShells );
+    GEOM::GEOM_Object_var anObj = anOper->MakeSolidShells( myShells );
 
     if ( !anObj->_is_nil() )
       objects.push_back( anObj._retn() );
   }
   else {
     for ( int i = 0, n = myShells.length(); i< n; i++ ) {
-      GEOM::GEOM_Object_var anObj = GEOM::GEOM_IShapesOperations::_narrow(
-        getOperation() )->MakeSolidShell( myShells[ i ] );
+      GEOM::GEOM_Object_var anObj = anOper->MakeSolidShell( myShells[ i ] );
 
      if ( !anObj->_is_nil() )
        objects.push_back( anObj._retn() );
index 5acb5845ecfc2fd47009f1f769d38636c1db6fd7..58d24c027ac4f568032b1c97619fe21ab8246f1c 100644 (file)
@@ -252,10 +252,8 @@ bool BuildGUI_WireDlg::isValid (QString& msg)
 //=================================================================================
 bool BuildGUI_WireDlg::execute (ObjectList& objects)
 {
-  GEOM::GEOM_Object_var anObj;
-
-  anObj = GEOM::GEOM_IShapesOperations::_narrow(getOperation())->
-    MakeWire(myEdgesAndWires, GroupArgs->SpinBox_DX->value());
+  GEOM::GEOM_IShapesOperations_var anOper = GEOM::GEOM_IShapesOperations::_narrow( getOperation() );
+  GEOM::GEOM_Object_var anObj = anOper->MakeWire(myEdgesAndWires, GroupArgs->SpinBox_DX->value());
 
   if (!anObj->_is_nil())
     objects.push_back(anObj._retn());