Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErwin Coumans <blender@erwincoumans.com>2006-05-14 03:31:36 +0400
committerErwin Coumans <blender@erwincoumans.com>2006-05-14 03:31:36 +0400
commit4a5826fa83f15dad702a65438b36ec6d1f0f30df (patch)
tree9a85a95403f3669c335316eb90734cf3c3698c29 /source/gameengine/Ketsji
parentd790049639eb4b2517cfaf3d7a3e1fe2e2b21281 (diff)
Patch from Charlie:
Cleared the python dictionary at the end of the game engine, should fix some issues, also reverted the python controller changes, related to this This should fix the following bugs: [ #3789 ] [ #3815 ] possiblyy fixes: [ #3834 ]
Diffstat (limited to 'source/gameengine/Ketsji')
-rw-r--r--source/gameengine/Ketsji/KX_KetsjiEngine.h2
-rw-r--r--source/gameengine/Ketsji/KX_PythonInit.cpp9
-rw-r--r--source/gameengine/Ketsji/KX_PythonInit.h2
-rw-r--r--source/gameengine/Ketsji/KX_Scene.cpp3
4 files changed, 15 insertions, 1 deletions
diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.h b/source/gameengine/Ketsji/KX_KetsjiEngine.h
index c476cdb5894..d78ad955e1a 100644
--- a/source/gameengine/Ketsji/KX_KetsjiEngine.h
+++ b/source/gameengine/Ketsji/KX_KetsjiEngine.h
@@ -96,12 +96,14 @@ private:
int m_activecam;
bool m_bFixedTime;
+
bool m_firstframe;
int m_currentFrame;
double m_frameTime;//discrete timestamp of the 'game logic frame'
double m_clockTime;//current time
double m_previousClockTime;//previous clock time
+ double m_remainingTime;
static double m_ticrate;
diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp
index f86b984c789..65751a995d9 100644
--- a/source/gameengine/Ketsji/KX_PythonInit.cpp
+++ b/source/gameengine/Ketsji/KX_PythonInit.cpp
@@ -784,6 +784,15 @@ PyObject* initGameLogic(KX_Scene* scene) // quick hack to get gravity hook
return d;
}
+void dictionaryClearByHand(PyObject *dict)
+{
+ // Clears the dictionary by hand:
+ // This prevents, extra references to global variables
+ // inside the GameLogic dictionary when the python interpreter is finalized.
+ // which allows the scene to safely delete them :)
+ // see: (space.c)->start_game
+ if(dict) PyDict_Clear(dict);
+}
// Python Sandbox code
diff --git a/source/gameengine/Ketsji/KX_PythonInit.h b/source/gameengine/Ketsji/KX_PythonInit.h
index 85616e26b6c..a4c2d1453a6 100644
--- a/source/gameengine/Ketsji/KX_PythonInit.h
+++ b/source/gameengine/Ketsji/KX_PythonInit.h
@@ -50,6 +50,8 @@ PyObject* initGamePlayerPythonScripting(const STR_String& progname, TPythonSecur
void exitGamePlayerPythonScripting();
PyObject* initGamePythonScripting(const STR_String& progname, TPythonSecurityLevel level);
void exitGamePythonScripting();
+void dictionaryClearByHand(PyObject *dict);
+
void PHY_SetActiveScene(class KX_Scene* scene);
#include "MT_Vector3.h"
diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp
index bdeffd79a60..1706937f8df 100644
--- a/source/gameengine/Ketsji/KX_Scene.cpp
+++ b/source/gameengine/Ketsji/KX_Scene.cpp
@@ -181,7 +181,7 @@ KX_Scene::~KX_Scene()
if(m_objectlist)
m_objectlist->Release();
-
+
if (m_parentlist)
m_parentlist->Release();
@@ -210,6 +210,7 @@ KX_Scene::~KX_Scene()
{
delete m_bucketmanager;
}
+
//Py_DECREF(m_attrlist);
}