https://bugs.kde.org/show_bug.cgi?id=401512

Franco Pasquarelli <franco.pasquare...@unicatt.it> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |franco.pasquarelli@unicatt.
                   |                            |it

--- Comment #5 from Franco Pasquarelli <franco.pasquare...@unicatt.it> ---
Also the following diff solve the problem

diff --git a/scripting/python_scripter.cc b/scripting/python_scripter.cc
index 62a7409b..ada48861 100644
--- a/scripting/python_scripter.cc
+++ b/scripting/python_scripter.cc
@@ -527,13 +527,14 @@ ObjectImp* PythonScripter::calc( CompiledPythonScript&
script, const Args& args
     handle<> argstuph( PyTuple_New( args.size() ) );
     for ( int i = 0; i < (int) objectvect.size(); ++i )
     {
+      Py_XINCREF((objectvect.begin() +i)->ptr());
       PyTuple_SetItem( argstuph.get(), i, (objectvect.begin() +i)->ptr() );
     };
+
+      
     tuple argstup( argstuph );

     handle<> reth( PyEval_CallObject( calcfunc.ptr(), argstup.ptr() ) );
-//    object resulto = calcfunc( argstup );
-//    handle<> reth( PyEval_CallObject( calcfunc.ptr(), args ) );
     object resulto( reth );

     extract<ObjectImp&> result( resulto );

where I increase the reference count of the arguments

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to