From 62f2925e438fae25f0dab615a7932774586669f3 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 15 Sep 2020 13:23:06 +1000 Subject: Fix T80774: (correction) keep MEM_init_memleak_detection call early --- source/creator/creator.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'source/creator') diff --git a/source/creator/creator.c b/source/creator/creator.c index 68753366c7d..d2bfcb64b53 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -297,6 +297,7 @@ int main(int argc, break; } } + MEM_init_memleak_detection(); } #ifdef BUILD_DATE @@ -399,6 +400,10 @@ int main(int argc, main_args_setup(C, ba); + /* Begin argument parsing, ignore leaks so arguments that call #exit + * (such as '--version' & '--help') don't report leaks. */ + MEM_use_memleak_detection(false); + BLI_argsParse(ba, 1, NULL, NULL); main_signal_setup(); @@ -499,9 +504,8 @@ 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(); + /* End argument parsing, allow memory leaks to be printed. */ + MEM_use_memleak_detection(true); /* Paranoid, avoid accidental re-use. */ #ifndef WITH_PYTHON_MODULE -- cgit v1.2.3