Re: return (PyObject*)myPyType; ...segmentation fault!
- From: "elho" <eh1@xxxxxxxxx>
- Date: 30 Sep 2005 04:04:35 -0700
> > It is said that the object has a NULL-Pointer when I try to debug it?
> what object?
the python one 'myNewPyType'
Sorry, I forgot to change:
PySDLXMLNodeType = PyMyType
...above the corrections
// == PyMyExtention.c =================================================
..
:
typedef struct {
PyObject_HEAD
long lAttribute;
} PyMyObject;
static PyObject* PyMyObject_NewC (long lAttribute)
{
PyMyObject *self;
PyMyObject *type;
self = new PyMyObject
self->lAttribute = lAttribute;
return (PyObject*)self;
}
static PyMethodDef PyMyObject_methods[] = {
{"PyMyObject_NewC", (PyCFunction)PyMyObject_NewC, METH_NOARGS,
"Create PyMyObject_NewC from C-Code"},
{NULL} /* Sentinel */
};
:
static PyTypeObject PyMyType = {
PyObject_HEAD_INIT(NULL)
:
};
//===================================================================/
.
- References:
- Re: return (PyObject*)myPyType; ...segmentation fault!
- From: Fredrik Lundh
- Re: return (PyObject*)myPyType; ...segmentation fault!
- Prev by Date: Re: Will python never intend to support private, protected and public?
- Next by Date: Re: Will python never intend to support private, protected and public?
- Previous by thread: Re: return (PyObject*)myPyType; ...segmentation fault!
- Next by thread: Re: Hello gnome-terminal
- Index(es):