fix [#27071] Random crashes when altering a mesh vertex vector in BGE
authorCampbell Barton <ideasman42@gmail.com>
Thu, 6 Oct 2011 16:07:05 +0000 (16:07 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 6 Oct 2011 16:07:05 +0000 (16:07 +0000)
thanks to Chris Holland (topher77) for supplying the fix.

source/gameengine/Ketsji/KX_VertexProxy.cpp

index 5589d35f44a3a9bcf699828d0e2a51a52e0d0624..e92351ad11099bf2f003398892bfd0fd3f12ecbd 100644 (file)
@@ -436,10 +436,14 @@ KX_VertexProxy::KX_VertexProxy(KX_MeshProxy*mesh, RAS_TexVert* vertex)
 :      m_vertex(vertex),
        m_mesh(mesh)
 {
 :      m_vertex(vertex),
        m_mesh(mesh)
 {
+       /* see bug [#27071] */
+       Py_INCREF(m_mesh->GetProxy());
 }
 
 KX_VertexProxy::~KX_VertexProxy()
 {
 }
 
 KX_VertexProxy::~KX_VertexProxy()
 {
+       /* see bug [#27071] */
+       Py_DECREF(m_mesh->GetProxy());
 }
 
 
 }