From f73c993b16c4083f0c72b87ba3f70fa12a5077df Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 27 Feb 2011 04:01:58 +0000 Subject: - use Py_CLEAR for python internally referencing other PyObjects (supposed to be safer). - detect includes for qtcreator projects as well as the ones from cmake (it didnt return all of the right paths). --- source/gameengine/Ketsji/KX_Scene.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source/gameengine/Ketsji/KX_Scene.cpp') diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index 0a8c3039ae3..4a379f46440 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -269,10 +269,12 @@ KX_Scene::~KX_Scene() #ifdef WITH_PYTHON PyDict_Clear(m_attr_dict); - Py_DECREF(m_attr_dict); + /* Py_CLEAR: Py_DECREF's and NULL's */ + Py_CLEAR(m_attr_dict); - Py_XDECREF(m_draw_call_pre); - Py_XDECREF(m_draw_call_post); + /* these may be NULL but the macro checks */ + Py_CLEAR(m_draw_call_pre); + Py_CLEAR(m_draw_call_post); #endif } -- cgit v1.2.3