From: mkr Date: Thu, 20 Oct 2005 08:46:57 +0000 (+0000) Subject: Fix for bug IPAL10345 : S2_M: Attempt to add new node in Supervisor leads to crash... X-Git-Tag: V2_2_6~8 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=be3fa7ec41f1d2e7efa6762525b52cc5efd40e2e;p=modules%2Fsuperv.git Fix for bug IPAL10345 : S2_M: Attempt to add new node in Supervisor leads to crash of application. --- diff --git a/src/GraphEditor/DataFlowEditor_OutNode.cxx b/src/GraphEditor/DataFlowEditor_OutNode.cxx index da51219..43ee44b 100644 --- a/src/GraphEditor/DataFlowEditor_OutNode.cxx +++ b/src/GraphEditor/DataFlowEditor_OutNode.cxx @@ -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] ;