Bug fixed in sf.String
Code clean up git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/trunk@1037 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
parent
e28a89f902
commit
870d049bc8
4 changed files with 22 additions and 14 deletions
|
@ -38,19 +38,22 @@ bool CustomSoundStream::OnStart()
|
|||
Py_DECREF(OnStart);
|
||||
Py_DECREF(Result);
|
||||
}
|
||||
if (PyErr_Occurred())
|
||||
{
|
||||
PyErr_Print();
|
||||
return false;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
bool CustomSoundStream::OnGetData(Chunk& Data)
|
||||
{
|
||||
bool result = false;
|
||||
if (PyData != NULL) {
|
||||
Py_DECREF(PyData);
|
||||
}
|
||||
Py_XDECREF(PyData);
|
||||
PyData = NULL;
|
||||
if (PyObject_HasAttrString(SoundStream, "OnGetData"))
|
||||
{
|
||||
PyObject *Function = PyObject_GetAttrString(SoundStream, "OnGetData");
|
||||
Data.NbSamples = 0;
|
||||
PyData = PyObject_CallFunction(Function, NULL);
|
||||
if (PyData != NULL)
|
||||
{
|
||||
|
@ -63,6 +66,13 @@ bool CustomSoundStream::OnGetData(Chunk& Data)
|
|||
}
|
||||
Py_DECREF(Function);
|
||||
}
|
||||
if (PyErr_Occurred())
|
||||
{
|
||||
PyErr_Print();
|
||||
Py_XDECREF(PyData);
|
||||
PyData = NULL;
|
||||
return false;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue