From 1782be5c72cc5cd72a710d5d6cbcf52b38b8b2ae Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 30 Apr 2009 00:51:11 +0000 Subject: [PATCH] Not sure why this INCREF is needed since making a replica wont use the m_bytecode so why should it add a user? Removed in 19974 but that crashes YoFrankie so adding back in for now. --- source/gameengine/GameLogic/SCA_PythonController.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/gameengine/GameLogic/SCA_PythonController.cpp b/source/gameengine/GameLogic/SCA_PythonController.cpp index 33207950697..d443c1688e4 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.cpp +++ b/source/gameengine/GameLogic/SCA_PythonController.cpp @@ -96,7 +96,11 @@ SCA_PythonController::~SCA_PythonController() CValue* SCA_PythonController::GetReplica() { SCA_PythonController* replica = new SCA_PythonController(*this); - // Copy the compiled bytecode if possible. + + /* why is this needed at all??? - m_bytecode is NULL'd below so this doesnt make sense + * but removing it crashes blender (with YoFrankie). so leave in for now - Campbell */ + Py_XINCREF(replica->m_bytecode); + Py_XINCREF(replica->m_function); // this is ok since its not set to NULL replica->m_bModified = replica->m_bytecode == NULL;