*/
void __attribute__ ((constructor)) leak_detective_init()
{
- install_hooks();
+ if (getenv("LEAK_DETECTIVE_DISABLE") == NULL)
+ {
+ install_hooks();
+ }
}
/**
*/
void __attribute__ ((destructor)) leak_detective_cleanup()
{
- uninstall_hooks();
- report_leaks();
+ if (getenv("LEAK_DETECTIVE_DISABLE") == NULL)
+ {
+ uninstall_hooks();
+ report_leaks();
+ }
}
/**
size_t bytes = 0;
memory_header_t *hdr = &first_header;
+ if (getenv("LEAK_DETECTIVE_DISABLE"))
+ {
+ return;
+ }
+
pthread_mutex_lock(&mutex);
while ((hdr = hdr->next))
{