Report total unfreed memory size on exit

Previously only number of unfreed blocks would have been printed,
which might not be totally enough during investigation process.
This commit is contained in:
Sergey Sharybin 2015-02-19 02:08:09 +05:00
parent 6c5f63b476
commit b5a14c381c
1 changed files with 4 additions and 1 deletions

View File

@ -537,7 +537,10 @@ void WM_exit_ext(bContext *C, const bool do_python)
BLI_threadapi_exit();
if (MEM_get_memory_blocks_in_use() != 0) {
printf("Error: Not freed memory blocks: %d\n", MEM_get_memory_blocks_in_use());
size_t mem_in_use = MEM_get_memory_in_use() + MEM_get_memory_in_use();
printf("Error: Not freed memory blocks: %d, total unfreed memory %f MB\n",
MEM_get_memory_blocks_in_use(),
(double)mem_in_use / 1024 / 1024);
MEM_printmemlist();
}
wm_autosave_delete();