[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [33829] trunk/blender/source/gameengine: Plugging up some memory leaks in the Blenderplayer that I found with valgrind

Mitchell Stokes mogurijin at gmail.com
Tue Dec 21 07:58:50 CET 2010


Revision: 33829
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=33829
Author:   moguri
Date:     2010-12-21 07:58:44 +0100 (Tue, 21 Dec 2010)

Log Message:
-----------
Plugging up some memory leaks in the Blenderplayer that I found with valgrind

Modified Paths:
--------------
    trunk/blender/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
    trunk/blender/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
    trunk/blender/source/gameengine/VideoTexture/PyTypeList.cpp
    trunk/blender/source/gameengine/VideoTexture/PyTypeList.h

Modified: trunk/blender/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
===================================================================
--- trunk/blender/source/gameengine/GamePlayer/ghost/GPG_Application.cpp	2010-12-21 05:52:34 UTC (rev 33828)
+++ trunk/blender/source/gameengine/GamePlayer/ghost/GPG_Application.cpp	2010-12-21 06:58:44 UTC (rev 33829)
@@ -802,7 +802,6 @@
 		m_canvas = 0;
 	}
 
-	IMB_exit();
 	GPU_extensions_exit();
 
 	m_exitRequested = 0;

Modified: trunk/blender/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
===================================================================
--- trunk/blender/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp	2010-12-21 05:52:34 UTC (rev 33828)
+++ trunk/blender/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp	2010-12-21 06:58:44 UTC (rev 33829)
@@ -943,8 +943,13 @@
 		}
 	}
 
-	free_nodesystem();
+	// Cleanup
+	RNA_exit();
+	BLF_exit();
+	free_blender();
 
+	SYS_DeleteSystem(syshandle);
+
 	return error ? -1 : 0;
 }
 

Modified: trunk/blender/source/gameengine/VideoTexture/PyTypeList.cpp
===================================================================
--- trunk/blender/source/gameengine/VideoTexture/PyTypeList.cpp	2010-12-21 05:52:34 UTC (rev 33828)
+++ trunk/blender/source/gameengine/VideoTexture/PyTypeList.cpp	2010-12-21 06:58:44 UTC (rev 33829)
@@ -28,6 +28,12 @@
 
 #include <PyObjectPlus.h>
 
+/// destructor
+PyTypeList::~PyTypeList()
+{
+	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)

Modified: trunk/blender/source/gameengine/VideoTexture/PyTypeList.h
===================================================================
--- trunk/blender/source/gameengine/VideoTexture/PyTypeList.h	2010-12-21 05:52:34 UTC (rev 33828)
+++ trunk/blender/source/gameengine/VideoTexture/PyTypeList.h	2010-12-21 06:58:44 UTC (rev 33829)
@@ -41,6 +41,9 @@
 class PyTypeList
 {
 public:
+	/// destructor
+	~PyTypeList();
+
 	/// check, if type is in list
 	bool in (PyTypeObject * type);
 





More information about the Bf-blender-cvs mailing list