forked from bartvdbraak/blender
More refcount errors spotted by Benoit, one with python getting a list item so scene.objects["OBfoo"] would always mess up refcounts.
This commit is contained in:
parent
cfc21667b9
commit
355b585447
@ -78,13 +78,15 @@ PyObject* listvalue_mapping_subscript(PyObject* self, PyObject* pyindex)
|
||||
STR_String index(PyString_AsString(pyindex));
|
||||
CValue *item = ((CListValue*) list)->FindValue(index);
|
||||
if (item)
|
||||
{
|
||||
item->Release(); /* FindValue() AddRef's */
|
||||
return item->GetProxy();
|
||||
|
||||
}
|
||||
}
|
||||
if (PyInt_Check(pyindex))
|
||||
else if (PyInt_Check(pyindex))
|
||||
{
|
||||
int index = PyInt_AsLong(pyindex);
|
||||
return listvalue_buffer_item(self, index);
|
||||
return listvalue_buffer_item(self, index); /* wont add a ref */
|
||||
}
|
||||
|
||||
PyObject *pyindex_str = PyObject_Repr(pyindex); /* new ref */
|
||||
|
@ -715,6 +715,7 @@ void KX_BlenderMaterial::setObjectMatrixData(int i, RAS_IRasterizer *ras)
|
||||
mScene->GetObjectList()->FindValue(mMaterial->mapping[i].objconame);
|
||||
|
||||
if(!obj) return;
|
||||
obj->Release(); /* FindValue() AddRef's */
|
||||
|
||||
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR );
|
||||
glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR );
|
||||
|
Loading…
Reference in New Issue
Block a user