Fix T80774: Leaks reported using '--version' command line argument

Caused by 236ca8fbe8.
This commit is contained in:
Campbell Barton 2020-09-15 12:45:03 +10:00
parent 61cd0d5bd5
commit 2120acb73e
Notes: blender-bot 2023-02-14 06:17:14 +01:00
Referenced by issue #80774, Mac/Linux Not freed memory blocks showing version from command line
1 changed files with 4 additions and 1 deletions

View File

@ -297,7 +297,6 @@ int main(int argc,
break;
}
}
MEM_init_memleak_detection();
}
#ifdef BUILD_DATE
@ -500,6 +499,10 @@ int main(int argc,
callback_main_atexit(&app_init_data);
BKE_blender_atexit_unregister(callback_main_atexit, &app_init_data);
/* Initialize memory leak detection after parsing command line arguments
* so arguments that call #exit (such as '--version' & '--help') don't report leaks. */
MEM_init_memleak_detection();
/* Paranoid, avoid accidental re-use. */
#ifndef WITH_PYTHON_MODULE
ba = NULL;