exception exit failed with c++ call python script
<p>When my exe exiting after python script finish,I got a error point to <strong>crt0dat.c</strong>
<img src="http://i.stack.imgur.com/nGpfP.png" alt="enter image description here">
The call stack like this...
<img src="http://i.stack.imgur.com/pGKLj.png" alt="enter image description here">
Are there some error in my c++ code or in the python code?</p>

<p>the c++ code like this:</p>

<pre><code>void PythonCall::call(std::vector&lt;double&gt;&amp; s,std::vector&lt;double&gt;&amp; b,std::vector&lt;double&gt;&amp; t,std::vector&lt;double&gt;&amp; y)
{

    PyObject* args = PyTuple_New(2);
    PyObject* tPyList = convert2PythonList(t);
    PyObject* yPyList = convert2PythonList(y);
    PyTuple_SetItem(args,0,tPyList);
    PyTuple_SetItem(args,1,yPyList);

    PyObject* r = PyObject_CallObject(func,args);

    PyObject* item;


    PyObject* iter = PyObject_GetIter(r);
    /*{
    PyObject *errtype, *errvalue, *traceback;
    PyErr_Fetch(&amp;errtype, &amp;errvalue, &amp;traceback);
    PyObject *s = PyObject_Str(errvalue);
    char *errstr = PyString_AsString(s);
    std::cout &lt;&lt; "Python Error: " &lt;&lt; errstr; 
    }*/


    item = PyIter_Next(iter);
    int i = 0;
    PyObject* iter2 = PyObject_GetIter(item);
    PyObject* item2;
    while (item2 = PyIter_Next(iter2))
    {
        s[i] = PyFloat_AsDouble(item2);
        Py_XDECREF(item2);
        i++;
    }
    Py_XDECREF(item);
    //Py_XDECREF(iter2);

    item = PyIter_Next(iter);
    i = 0;
    iter2 = PyObject_GetIter(item);
    while (item2 = PyIter_Next(iter2))
    {
        b[i] = PyFloat_AsDouble(item2);
        Py_XDECREF(item2);
        i++;
    }
    Py_XDECREF(item);
    //Py_XDECREF(iter2);

    //Py_XDECREF(iter);
    Py_XDECREF(args);
    Py_XDECREF(r);
    Py_XDECREF(item);
    Py_XDECREF(tPyList);
    Py_XDECREF(yPyList);
    //std::cout &lt;&lt; "done" &lt;&lt; std::endl;
}
</code></pre>

<p>and the python code:</p>

<pre><code>def get_slope_baseLine(tl,xl):
    slopes = get_slope2(tl,xl)
    baselines = get_leakTime(tl,slopes)
    return slopes,baselines
</code></pre>

<p>sorry about my poor English...</p>
