From 0e70290e00122fa38453c01885466e5af84c4380 Mon Sep 17 00:00:00 2001 From: mkr Date: Fri, 3 Feb 2006 07:38:45 +0000 Subject: [PATCH] Fix for PAL8004 : CRASH after trying to run edited MacroNode execution. --- src/GraphEditor/DataFlowEditor_OutNode.cxx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/GraphEditor/DataFlowEditor_OutNode.cxx b/src/GraphEditor/DataFlowEditor_OutNode.cxx index 5221b4f..52d6601 100644 --- a/src/GraphEditor/DataFlowEditor_OutNode.cxx +++ b/src/GraphEditor/DataFlowEditor_OutNode.cxx @@ -36,14 +36,11 @@ using namespace std; map< string , int > _MapOfGraphNames; string GraphInstanceName( const char * aGraphName ) { + // mkr : PAL8004 --> + // For Macro nodes : names of subgraphs must be unique and differ from the main dataflow + // name (i.e. the dataflow with MacroLevel = 0). + // It is neccessary for reqursive call of LoadDataFlows(...) method for MacroNodes execution. int GraphInstanceNumber = _MapOfGraphNames[ aGraphName ] ; - if ( GraphInstanceNumber ) { - _MapOfGraphNames[ aGraphName ] = GraphInstanceNumber + 1 ; - } - else { - GraphInstanceNumber = 0 ; - _MapOfGraphNames[ aGraphName ] = GraphInstanceNumber + 1 ; - } string theGraphInstanceName = string( aGraphName ) ; if ( GraphInstanceNumber ) { theGraphInstanceName += "_" ; @@ -51,6 +48,10 @@ string GraphInstanceName( const char * aGraphName ) { astr << GraphInstanceNumber ; theGraphInstanceName += astr.str() ; } + if ( theGraphInstanceName != string( aGraphName ) ) + _MapOfGraphNames[ theGraphInstanceName ] = GraphInstanceNumber ; + _MapOfGraphNames[ aGraphName ] = GraphInstanceNumber + 1 ; + // mkr : PAL8004 <-- return theGraphInstanceName ; } -- 2.39.2