Salome HOME
Fix memory leaks
[modules/geom.git] / src / PrimitiveGUI / PrimitiveGUI_CylinderDlg.cxx
index b77bd11a36ee62b7b0373fb1d973e232e02efe79..b7123270b51cb48907563196d9c49de315e5a6d1 100644 (file)
@@ -461,30 +461,30 @@ bool PrimitiveGUI_CylinderDlg::execute (ObjectList& objects)
 
   GEOM::GEOM_Object_var anObj;
 
+  GEOM::GEOM_I3DPrimOperations_var anOper = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation());
+
   switch (getConstructorId()) {
   case 0:
     if (!CORBA::is_nil(myPoint) && !CORBA::is_nil(myDir)) {
-      anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
-        MakeCylinderPntVecRH(myPoint, myDir, getRadius(), getHeight());
+      anObj = anOper->MakeCylinderPntVecRH(myPoint, myDir, getRadius(), getHeight());
       if (!anObj->_is_nil() && !IsPreview())
       {
        QStringList aParameters;
        aParameters << GroupPoints->SpinBox_DX->text();
        aParameters << GroupPoints->SpinBox_DY->text();
-       anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+        anObj->SetParameters(aParameters.join(":").toLatin1().constData());
       }
       res = true;
     }
     break;
   case 1:
-    anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
-      MakeCylinderRH(getRadius(), getHeight());
+    anObj = anOper->MakeCylinderRH(getRadius(), getHeight());
     if (!anObj->_is_nil() && !IsPreview())
     {
       QStringList aParameters;
       aParameters << GroupDimensions->SpinBox_DX->text();
       aParameters << GroupDimensions->SpinBox_DY->text();
-      anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+      anObj->SetParameters(aParameters.join(":").toLatin1().constData());
     }
     res = true;
     break;