]> SALOME platform Git repositories - modules/superv.git/commitdiff
Salome HOME
Fix for bug IPAL10345 : S2_M: Attempt to add new node in Supervisor leads to crash...
authormkr <mkr@opencascade.com>
Thu, 20 Oct 2005 08:46:57 +0000 (08:46 +0000)
committermkr <mkr@opencascade.com>
Thu, 20 Oct 2005 08:46:57 +0000 (08:46 +0000)
src/GraphEditor/DataFlowEditor_OutNode.cxx

index da5121901fa0ede30fa52726b7a90408eff7def6..43ee44bd8cbf2794f3306b7367e1e624334c34b4 100644 (file)
@@ -693,7 +693,13 @@ GraphEditor::InNode * GraphEditor::OutNode::AddNode(
         int num = Graph()->GetServiceNameNumber( NodeService ) ;
         ostringstream astr ;
         astr << num << ends ;
-        const char * n_instance = astr.str().c_str() ;
+
+       // mkr : fix for bug IPAL10345
+       string aStr = astr.str();
+       char* n_instance = new char[aStr.length() + 1];
+       aStr.copy( n_instance, string::npos );
+       n_instance[aStr.length()] = 0;
+
         int lname = strlen( NodeService.ServiceName ) + 1 +
                     strlen( n_instance ) + 1 ;
         aNodeName = new char[lname] ;