Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPorteries Tristan <republicthunderbolt9@gmail.com>2015-10-28 23:58:40 +0300
committerPorteries Tristan <republicthunderbolt9@gmail.com>2015-10-29 00:11:15 +0300
commita15a3952f4270bb0ddb28d8118fc63707e065bde (patch)
tree177e3134ea2afcc26f18186713bd550af396fd28 /source/gameengine/Ketsji/KX_GameObject.cpp
parent138decb7dc6e4c067c8c290b8a034808893bba1f (diff)
BGE: Fix T35188: Duplicate an instance of group.
This behavior caused a double free. Before when we duplicated an instance of a group the new instance keep the pointer of the group but was not added in the group instance list (normal). And during the object deletion we tried to remove the object in the instance list but anyways if it failed decrement the reference count. Set the group and the instance list to NULL in ProcessReplica avoid these kind of problems.
Diffstat (limited to 'source/gameengine/Ketsji/KX_GameObject.cpp')
-rw-r--r--source/gameengine/Ketsji/KX_GameObject.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp
index 974a2e56d16..5e66250bd80 100644
--- a/source/gameengine/Ketsji/KX_GameObject.cpp
+++ b/source/gameengine/Ketsji/KX_GameObject.cpp
@@ -518,6 +518,11 @@ void KX_GameObject::ProcessReplica()
m_pGraphicController = NULL;
m_pPhysicsController = NULL;
m_pSGNode = NULL;
+
+ /* Dupli group and instance list are set later in replication.
+ * See KX_Scene::DupliGroupRecurse. */
+ m_pDupliGroupObject = NULL;
+ m_pInstanceObjects = NULL;
m_pClient_info = new KX_ClientObjectInfo(*m_pClient_info);
m_pClient_info->m_gameobject = this;
m_actionManager = NULL;