Message92444
When embedding python from C, and importing "ctypes" module in embedded
script, it always crashes on Py_Finalize() on 4th cycle.
Tested with both PyRun_SimpleString(...) and PyRun_String(...).
Platform: Windows XP
IDE's: LabWindows/CVI 8.5 and Code::Blocks/gcc
Code:
--------------------------
#include <stdio.h>
#include <python.h>
int main()
{
int i;
for (i=0; i<10; i++)
{
printf("--- %d ---\n", i);
Py_Initialize();
PyRun_SimpleString("import ctypes");
Py_Finalize();
}
return 0;
}
--------------------------------
Output:
--------------------------------
--- 0 ---
--- 1 ---
--- 2 ---
--- 3 ---
Process returned -1073741819 (0xC0000005) execution time : 3.109 s
Press any key to continue.
-------------------------------- |
|
Date |
User |
Action |
Args |
2009-09-09 08:31:16 | warlock | set | recipients:
+ warlock, theller |
2009-09-09 08:31:15 | warlock | set | messageid: <1252485075.59.0.965228056128.issue6869@psf.upfronthosting.co.za> |
2009-09-09 08:31:13 | warlock | link | issue6869 messages |
2009-09-09 08:31:13 | warlock | create | |
|