From 5553d2c0142539c754575ce471c2676e0d5dff34 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 22 Apr 2009 14:42:00 +0000 Subject: BGE C++ API PyObjectPlus::ProcessReplica() is now called when any of its subclasses are replicated. This is important because PyObjectPlus::ProcessReplica() NULL's the 'm_proxy' python pointer I added recently. Without this a replicated subclass of PyObjectPlus could have an invalid pointer (crashing the BGE). This change also means CValue::AddDataToReplica() can be moved into CValue::ProcessReplica() since ProcessReplica is always called. --- source/gameengine/Converter/BL_SkinDeformer.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/gameengine/Converter/BL_SkinDeformer.cpp') diff --git a/source/gameengine/Converter/BL_SkinDeformer.cpp b/source/gameengine/Converter/BL_SkinDeformer.cpp index ae3e1a10005..3267dbce410 100644 --- a/source/gameengine/Converter/BL_SkinDeformer.cpp +++ b/source/gameengine/Converter/BL_SkinDeformer.cpp @@ -156,6 +156,8 @@ RAS_Deformer *BL_SkinDeformer::GetReplica(class KX_GameObject* replica) BL_SkinDeformer *result; result = new BL_SkinDeformer(*this); + /* Not inherited from PyObjectPlus so this isnt needed */ + /* Just call a dummy function below, will be optimized out */ result->ProcessReplica(); return result; } -- cgit v1.2.3