Report total unfreed memory size on exit
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 18 Feb 2015 21:08:09 +0000 (02:08 +0500)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 18 Feb 2015 21:08:09 +0000 (02:08 +0500)
Previously only number of unfreed blocks would have been printed,
which might not be totally enough during investigation process.

source/blender/windowmanager/intern/wm_init_exit.c

index cb03d022afd7f793183bb354650db5c8e71bd1ca..9778f1651de48bc025585c206c35637bc19f28c7 100644 (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();