Compiles with python 2.6
Fixed dangerous decref git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/trunk@1089 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
parent
494c8e6d0f
commit
5240c80229
2 changed files with 6 additions and 6 deletions
|
@ -39,10 +39,7 @@ extern PyTypeObject PySfDrawableType;
|
|||
static void
|
||||
PySfSprite_dealloc(PySfSprite *self)
|
||||
{
|
||||
if (self->Image != NULL)
|
||||
{
|
||||
Py_DECREF(self->Image);
|
||||
}
|
||||
Py_XDECREF(self->Image);
|
||||
delete self->obj;
|
||||
free_object(self);
|
||||
}
|
||||
|
@ -96,7 +93,7 @@ PySfSprite_SetImage(PySfSprite* self, PyObject *args)
|
|||
PyErr_SetString(PyExc_TypeError, "Sprite.SetImage() Argument is not a sf.Image");
|
||||
return NULL;
|
||||
}
|
||||
Py_DECREF(self->Image);
|
||||
Py_CLEAR(self->Image);
|
||||
Py_INCREF(Image);
|
||||
self->Image = Image;
|
||||
self->obj->SetImage(*(Image->obj));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue