intjelic / python-sfml

Official binding of SFML for Python
https://www.python-sfml.org
Other
176 stars 41 forks source link

Segfault when accessing transform position #136

Closed fazjaxton closed 7 years ago

fazjaxton commented 8 years ago

I am getting a Segmentation fault (core dumped) error on code that works on 1.5. I have narrowed it down to the following test case:

from sfml import sf

class Test (sf.TransformableDrawable):
    def __init__(self):
        pass

t = Test()
print t.position

Attempting to access the transform position causes the segfault. I am running latest python-sfml from git with SFML libs from Ubuntu 16.04.

intjelic commented 7 years ago

You're not initializing sf.TransformableDrawable with init() in the construction.

Also, make sure you use latest version. And checkout the fix-transformable-drawable branch. It's now possible to subclass from both sf.Drawable and sf.Transformable, leaving sf.TransformableDrawable obsolete.