diff options
author | Benoit Bolsee <benoit.bolsee@online.be> | 2008-04-15 02:45:28 +0400 |
---|---|---|
committer | Benoit Bolsee <benoit.bolsee@online.be> | 2008-04-15 02:45:28 +0400 |
commit | 6bb327badc63d65afe459e092059bf1d9c20b075 (patch) | |
tree | 67d1b892fbd8ca833c8e8a9326db680a1ebc0cf4 /source/gameengine | |
parent | 815791920f1f6172a1bf904351713c8a355da62d (diff) |
BGE fix: keep reference count consist on source object when replicating property copy actuator
Diffstat (limited to 'source/gameengine')
-rw-r--r-- | source/gameengine/GameLogic/SCA_PropertyActuator.cpp | 8 | ||||
-rw-r--r-- | source/gameengine/GameLogic/SCA_PropertyActuator.h | 2 |
2 files changed, 10 insertions, 0 deletions
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(); |