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:
authorMitchell Stokes <mogurijin@gmail.com>2010-12-21 09:58:44 +0300
committerMitchell Stokes <mogurijin@gmail.com>2010-12-21 09:58:44 +0300
commit48cda2e08e16986d2b5eff8e183ddfc126fe4085 (patch)
treeeac8e8a5eb885e82ef0bb0a2ac8c433d283d5071
parent9d289c602d289e0dbe2af951dbefeb67c89434af (diff)
Plugging up some memory leaks in the Blenderplayer that I found with valgrind
-rw-r--r--source/gameengine/GamePlayer/ghost/GPG_Application.cpp1
-rw-r--r--source/gameengine/GamePlayer/ghost/GPG_ghost.cpp7
-rw-r--r--source/gameengine/VideoTexture/PyTypeList.cpp8
-rw-r--r--source/gameengine/VideoTexture/PyTypeList.h3
4 files changed, 17 insertions, 2 deletions
diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
index 197e31af188..d1dee052173 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
+++ b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
@@ -802,7 +802,6 @@ void GPG_Application::exitEngine()
m_canvas = 0;
}
- IMB_exit();
GPU_extensions_exit();
m_exitRequested = 0;
diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
index d9aaa56b19e..b7f4cacf5ab 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
+++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
@@ -943,7 +943,12 @@ int main(int argc, char** argv)
}
}
- free_nodesystem();
+ // Cleanup
+ RNA_exit();
+ BLF_exit();
+ free_blender();
+
+ SYS_DeleteSystem(syshandle);
return error ? -1 : 0;
}
diff --git a/source/gameengine/VideoTexture/PyTypeList.cpp b/source/gameengine/VideoTexture/PyTypeList.cpp
index 2d571675dbd..c374348da26 100644
--- a/source/gameengine/VideoTexture/PyTypeList.cpp
+++ b/source/gameengine/VideoTexture/PyTypeList.cpp
@@ -28,6 +28,14 @@ http://www.gnu.org/copyleft/lesser.txt.
#include <PyObjectPlus.h>
+/// destructor
+PyTypeList::~PyTypeList()
+{
+ // if list exists
+ if (m_list.get() != NULL)
+ for (PyTypeListType::iterator it = m_list->begin(); it != m_list->end(); ++it)
+ delete *it;
+}
/// check, if type is in list
bool PyTypeList::in (PyTypeObject * type)
diff --git a/source/gameengine/VideoTexture/PyTypeList.h b/source/gameengine/VideoTexture/PyTypeList.h
index 4daf88bfa19..8ca1e976de7 100644
--- a/source/gameengine/VideoTexture/PyTypeList.h
+++ b/source/gameengine/VideoTexture/PyTypeList.h
@@ -41,6 +41,9 @@ typedef std::vector<PyTypeListItem*> PyTypeListType;
class PyTypeList
{
public:
+ /// destructor
+ ~PyTypeList();
+
/// check, if type is in list
bool in (PyTypeObject * type);