leak-detective: LEAK_DETECTIVE_DISABLE completely disables LD

If lib->leak_detective is non-null some code parts (e.g. the plugin
loader) assume LD is actually used.
This commit is contained in:
Tobias Brunner
2014-04-03 09:44:26 +02:00
parent 7a61bf9032
commit adc1157487
3 changed files with 23 additions and 17 deletions
+9 -6
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2013 Tobias Brunner
* Copyright (C) 2013-2014 Tobias Brunner
* Copyright (C) 2006-2013 Martin Willi
* Hochschule fuer Technik Rapperswil
*
@@ -973,17 +973,20 @@ leak_detective_t *leak_detective_create()
},
);
if (getenv("LEAK_DETECTIVE_DISABLE") != NULL)
{
free(this);
return NULL;
}
lock = spinlock_create();
thread_disabled = thread_value_create(NULL);
init_static_allocations();
if (getenv("LEAK_DETECTIVE_DISABLE") == NULL)
if (register_hooks())
{
if (register_hooks())
{
enable_leak_detective();
}
enable_leak_detective();
}
return &this->public;
}