access violation with C API

cptnwillard at gmail.com cptnwillard at gmail.com
Mon Sep 11 13:34:34 EDT 2006


Hello all,

The following triggers an "access violation" error, why?

		pPyType = (PyTypeObject*)malloc(sizeof(PyTypeObject));
		memset(pPyType, 0, sizeof(PyTypeObject));
		pPyType->ob_refcnt    = 1;
		pPyType->tp_name      = "noname";
		pPyType->tp_basicsize = sizeof(MyObject);
		pPyType->tp_flags     = Py_TPFLAGS_DEFAULT;
		pPyType->tp_doc       = "nodoc";
		PyType_Ready(pPyType);

Thanks.




More information about the Python-list mailing list