X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_CopyMeshDlg.cxx;h=e3d4f5f8de6b58e522d837d700171fcc62334095;hb=b212155ceadd521a9244243ef03c65975fe2e1f0;hp=fbb71ea96ee44b24bc8e648273a1d55643fba967;hpb=bd8f1aee7c78f7d2eb82bd4fec5e08c9e3d280ce;p=modules%2Fsmesh.git diff --git a/src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx b/src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx index fbb71ea96..e3d4f5f8d 100644 --- a/src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx @@ -98,10 +98,6 @@ namespace #define SPACING 6 #define MARGIN 11 -//To disable automatic genericobj management, the following line should be commented. -//Otherwise, it should be uncommented. Refer to KERNEL_SRC/src/SALOMEDSImpl/SALOMEDSImpl_AttributeIOR.cxx -#define WITHGENERICOBJ - //================================================================================ /*! @@ -312,10 +308,11 @@ bool SMESHGUI_CopyMeshDlg::ClickOnApply() try { SUIT_OverrideCursor aWaitCursor; - SMESH::SMESH_IDSource_var aPartToCopy; + SMESH::SMESH_IDSource_wrap aPartToCopy; if ( myIdSourceCheck->isChecked()) { aPartToCopy = mySelectedObject; + aPartToCopy->Register(); } else { @@ -338,13 +335,8 @@ bool SMESHGUI_CopyMeshDlg::ClickOnApply() if( !newMesh->_is_nil() ) if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( newMesh ) ) anEntryList.append( aSObject->GetID().c_str() ); -#ifdef WITHGENERICOBJ - // obj has been published in study. Its refcount has been incremented. - // It is safe to decrement its refcount - // so that it will be destroyed when the entry in study will be removed - newMesh->UnRegister(); -#endif - } catch (...) { + } + catch (...) { } mySMESHGUI->updateObjBrowser(true); @@ -485,7 +477,7 @@ void SMESHGUI_CopyMeshDlg::SelectionIntoArgument() // get selected mesh SALOME_ListIO aList; - mySelectionMgr->selectedObjects(aList,SVTK_Viewer::Type()); + mySelectionMgr->selectedObjects(aList); int nbSel = aList.Extent(); if (nbSel != 1) return;