From 4e7417e9fd1c083ede40389537dc642ec6513025 Mon Sep 17 00:00:00 2001 From: Mitchell Stokes Date: Thu, 7 Jul 2011 10:37:46 +0000 Subject: The Blenderplayer wasn't freeing GPU_Textures since according to BLI_threads, GPU_free_image() was never being called from the main thread. Calling BLI_threadapi_init() when the Blenderplayer starts sets the current thread as the main thread and solves the problem. --- source/gameengine/GamePlayer/ghost/GPG_ghost.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp index 14048c70516..cbbeb9419d1 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp @@ -64,6 +64,7 @@ extern "C" #include "BKE_node.h" #include "BKE_report.h" #include "BKE_library.h" +#include "BLI_threads.h" #include "BLI_blenlib.h" #include "DNA_scene_types.h" #include "DNA_userdef_types.h" @@ -399,7 +400,11 @@ int main(int argc, char** argv) ::DisposeNibReference(nibRef); */ #endif // __APPLE__ - + + // We don't use threads directly in the BGE, but we need to call this so things like + // freeing up GPU_Textures works correctly. + BLI_threadapi_init(); + RNA_init(); init_nodesystem(); -- cgit v1.2.3