From 6bb327badc63d65afe459e092059bf1d9c20b075 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Mon, 14 Apr 2008 22:45:28 +0000 Subject: BGE fix: keep reference count consist on source object when replicating property copy actuator --- source/gameengine/GameLogic/SCA_PropertyActuator.cpp | 8 ++++++++ source/gameengine/GameLogic/SCA_PropertyActuator.h | 2 ++ 2 files changed, 10 insertions(+) (limited to 'source/gameengine/GameLogic') diff --git a/source/gameengine/GameLogic/SCA_PropertyActuator.cpp b/source/gameengine/GameLogic/SCA_PropertyActuator.cpp index 29642cd5a7b..24b040db1bc 100644 --- a/source/gameengine/GameLogic/SCA_PropertyActuator.cpp +++ b/source/gameengine/GameLogic/SCA_PropertyActuator.cpp @@ -183,6 +183,14 @@ GetReplica() { }; +void SCA_PropertyActuator::ProcessReplica() +{ + // no need to check for self reference like in the constructor: + // the replica will always have a different parent + if (m_sourceObj) + m_sourceObj->AddRef(); + SCA_IActuator::ProcessReplica(); +} diff --git a/source/gameengine/GameLogic/SCA_PropertyActuator.h b/source/gameengine/GameLogic/SCA_PropertyActuator.h index cdcda7a84e0..fc993c9fce2 100644 --- a/source/gameengine/GameLogic/SCA_PropertyActuator.h +++ b/source/gameengine/GameLogic/SCA_PropertyActuator.h @@ -77,6 +77,8 @@ public: GetReplica( ); + void ProcessReplica(); + virtual bool Update(); -- cgit v1.2.3