Revert "Fix T37920: BGE LibLoad failed for meshes with no materials"

This reverts commit 6a473305af.

Caused T38296, need to investigate this further but for now
better not leave blender in unstable state.
This commit is contained in:
Campbell Barton 2014-01-23 00:49:58 +11:00
parent 9c883a1eca
commit 51c32ac199
Notes: blender-bot 2023-02-14 11:27:28 +01:00
Referenced by issue #38289, Game Engine addObject() crashes when adding a second object
Referenced by issue #37920, Repeatedly calling LibLoad and LibFree on the same library / blend will cause a crash.
4 changed files with 3 additions and 25 deletions

View File

@ -1313,8 +1313,6 @@ bool KX_BlenderSceneConverter::FreeBlendFile(struct Main *maggie)
int size_before = obs->GetCount();
gameobj->RemoveMeshes();
/* Eventually calls RemoveNodeDestructObject
* frees m_map_gameobject_to_blender from UnregisterGameObject */
scene->RemoveObject(gameobj);

View File

@ -558,7 +558,7 @@ RAS_MeshSlot* RAS_MaterialBucket::CopyMesh(RAS_MeshSlot *ms)
return &m_meshSlots.back();
}
void RAS_MaterialBucket::RemoveMeshSlot(RAS_MeshSlot *ms)
void RAS_MaterialBucket::RemoveMesh(RAS_MeshSlot* ms)
{
list<RAS_MeshSlot>::iterator it;
@ -570,20 +570,6 @@ void RAS_MaterialBucket::RemoveMeshSlot(RAS_MeshSlot *ms)
}
}
void RAS_MaterialBucket::RemoveMesh(RAS_MeshObject *mesh)
{
list<RAS_MeshSlot>::iterator it;
it=m_meshSlots.begin();
while (it != m_meshSlots.end()) {
if ((*it).m_mesh == mesh) {
m_meshSlots.erase(it++);
}
else {
++it;
}
}
}
list<RAS_MeshSlot>::iterator RAS_MaterialBucket::msBegin()
{
return m_meshSlots.begin();

View File

@ -228,8 +228,7 @@ public:
class RAS_MeshSlot* AddMesh(int numverts);
class RAS_MeshSlot* CopyMesh(class RAS_MeshSlot *ms);
void RemoveMeshSlot(class RAS_MeshSlot *ms);
void RemoveMesh(class RAS_MeshObject *mesh);
void RemoveMesh(class RAS_MeshSlot* ms);
void Optimize(MT_Scalar distance);
void ActivateMesh(RAS_MeshSlot* slot)
{

View File

@ -458,14 +458,9 @@ void RAS_MeshObject::RemoveFromBuckets(void *clientobj)
if (!msp)
continue;
/* see [#37920] */
#if 0
RAS_MeshSlot *ms = *msp;
it->m_bucket->RemoveMeshSlot(ms);
#else
it->m_bucket->RemoveMesh(this);
#endif
it->m_bucket->RemoveMesh(ms);
it->m_slots.remove(clientobj);
}
}