Hi,

maybe I've just got a lack of understanding or I don't know...

I've got a class that in general looks like this:

cpdef class Foo:
        cdef char* myData

        cdef void setData(Foo self, char *data)
                self.myData = data

        cpdef doSomething(Foo self)
                print self.myData

The problem is that working with myData directly from Cython is no
problem but calling doSomething from the python interpreter causes a
segfault because self.myData then points to NULL. I've also observed
that self in setData points to a different address than self in
doSomething if it is called from the interpreter.

What's the problem with this approach?

Thanks
Johannes

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to