Py_Finalize ERROR!

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • zaley

    Py_Finalize ERROR!

    Py_Finalize ERROR!

    In my C++ program ,python is embeded . I create one win thread to run
    embedded Python code .
    So at the begin of thread function I call "Py_Initial ize" and at the
    end of thread function call "Py_Finaliz e" .
    But after I began thread several times,the program crashed in
    function "Py_Finaliz e".
    I can see the error occured at function "PyObject_Clear WeakRefs" when
    "Py_Finaliz e" called "type_deall oc";

    Note: the python25.dll(li b) is builded by VC6(SP6)
  • Gabriel Genellina

    #2
    Re: Py_Finalize ERROR!

    On 19 feb, 05:11, zaley <lizhon...@gmai l.comwrote:
    Py_Finalize ERROR!
    >
    In my C++ program ,python is embeded . I create one win thread to run
    embedded Python code .
    So at the begin of thread function I call "Py_Initial ize" and at the
    end of thread function call "Py_Finaliz e" .
    But after I began thread several times,the program crashed  in
    function  "Py_Finaliz e".
    I can see the error occured at function "PyObject_Clear WeakRefs" when
    "Py_Finaliz e" called "type_deall oc";
    >
    Note: the python25.dll(li b) is builded by VC6(SP6)
    Try to not call repeatedly Py_Initialize/Py_Finalize, only at the
    start/end of your program. If only one thread is running Python at the
    same time I *think* you don't have to do any special handling.

    --
    Gabriel Genellina

    Comment

    Working...