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:
authorCampbell Barton <ideasman42@gmail.com>2011-03-26 07:50:59 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-03-26 07:50:59 +0300
commitcae59a78d84b1d61974d942538b4707a9565bb67 (patch)
treea463b34416ddaa83f0b61d3fcdea04dd931d7ef1 /source/gameengine/GamePlayer
parent04e32be958bb90be2824c083eba8f983d9133f76 (diff)
print guarded-alloc memory leaks on blenderplayer exit.
Diffstat (limited to 'source/gameengine/GamePlayer')
-rw-r--r--source/gameengine/GamePlayer/ghost/GPG_ghost.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
index 767ccff4259..65a68f1bac3 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
+++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
@@ -115,6 +115,12 @@ const int kMinWindowHeight = 100;
char bprogname[FILE_MAX];
+static void mem_error_cb(const char *errorStr)
+{
+ fprintf(stderr, "%s", errorStr);
+ fflush(stderr);
+}
+
#ifdef WIN32
typedef enum
{
@@ -834,9 +840,10 @@ int main(int argc, char** argv)
// GPG_Application app (system, maggie, startscenename);
app.SetGameEngineData(maggie, scene, argc, argv); /* this argc cant be argc_py_clamped, since python uses it */
-
BLI_strncpy(pathname, maggie->name, sizeof(pathname));
- BLI_strncpy(G.main->name, maggie->name, sizeof(G.main->name));
+ if(G.main != maggie) {
+ BLI_strncpy(G.main->name, maggie->name, sizeof(G.main->name));
+ }
#ifdef WITH_PYTHON
setGamePythonPath(G.main->name);
#endif
@@ -956,6 +963,13 @@ int main(int argc, char** argv)
SYS_DeleteSystem(syshandle);
+ int totblock= MEM_get_memory_blocks_in_use();
+ if(totblock!=0) {
+ printf("Error Totblock: %d\n",totblock);
+ MEM_set_error_callback(mem_error_cb);
+ MEM_printmemlist();
+ }
+
return error ? -1 : 0;
}