diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-09-15 05:45:03 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-09-15 05:46:29 +0300 |
commit | 2120acb73e4a76543d83247ed45c95990d705d64 (patch) | |
tree | 26ec4eb0b9864d2b9737b55faffbfdcf83ce1959 /source/creator/creator.c | |
parent | 61cd0d5bd58115741e0089adf56ac42e5c79d96d (diff) |
Fix T80774: Leaks reported using '--version' command line argument
Caused by 236ca8fbe8457550.
Diffstat (limited to 'source/creator/creator.c')
-rw-r--r-- | source/creator/creator.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/creator/creator.c b/source/creator/creator.c index 37fbf0cf76a..68753366c7d 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -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; |