From fb7b7636e0ec27036af93a5983d35aba44ceeb01 Mon Sep 17 00:00:00 2001 From: asv Date: Mon, 28 Feb 2005 11:54:32 +0000 Subject: [PATCH] A fix for a bug was integrated. The bug: Python function (body) was changed, but Automation would return PyObject for OLD function. The fix is very simple and it is to be reviewed in the future: it is forced to re-automate the function (re-create PyObject) every time, always. --- src/GraphExecutor/DataFlowExecutor_PyDynInvoke.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/GraphExecutor/DataFlowExecutor_PyDynInvoke.cxx b/src/GraphExecutor/DataFlowExecutor_PyDynInvoke.cxx index 4a553e4..ee6ed21 100644 --- a/src/GraphExecutor/DataFlowExecutor_PyDynInvoke.cxx +++ b/src/GraphExecutor/DataFlowExecutor_PyDynInvoke.cxx @@ -155,7 +155,19 @@ PyObject * GraphExecutor::InNode::InitPyDynInvoke( char * PyFuncName , if ( strlen( PyFuncName ) ) { Automaton()->PyLock() ; + thePyRunMethod = Automaton()->PyFunction( PyFuncName ) ; + + thePyRunMethod = NULL; + // asv 28.02.05 : VERY BAD fix of the following problem: after change of a function, + // the changes are NOT taken into account by Automation - it returns PyObject of the OLD function. + // so here we force re-automating the PyObject EVERY TIME, regardless if the function has changed or not. + // Once again - it is a very bad solution, it fully discards the whole idea of automation, + // here is it done as a quick fix for a bug. + // A better solution (to be implemented): store the PyObject NOT in Automation map, but in + // InLine node itself! And if the method is changed - remove the PyObject and force to regenerate it. + // But this means that PyObject must be stored in Editor's data model. + if ( (*aPythonFunction).length() ) { if ( thePyRunMethod == NULL ) { unsigned int i ; -- 2.39.2