diff options
author | Martin Willi <martin@revosec.ch> | 2011-04-29 14:52:32 +0200 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2011-05-16 15:22:21 +0200 |
commit | f37e8252a358e33e3a11701c99e5e63d20ce784f (patch) | |
tree | bc07ed13ec15530a9b43a144a8e25be21120f31b /src/libstrongswan/library.c | |
parent | 42e0f26e5339745f180e7b284beae32b8fb27c4d (diff) | |
download | strongswan-f37e8252a358e33e3a11701c99e5e63d20ce784f.tar.bz2 strongswan-f37e8252a358e33e3a11701c99e5e63d20ce784f.tar.xz |
Make leak detective public
Diffstat (limited to 'src/libstrongswan/library.c')
-rw-r--r-- | src/libstrongswan/library.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/src/libstrongswan/library.c b/src/libstrongswan/library.c index b7e75aec5..9fc99e3a9 100644 --- a/src/libstrongswan/library.c +++ b/src/libstrongswan/library.c @@ -40,13 +40,6 @@ struct private_library_t { * public functions */ library_t public; - -#ifdef LEAK_DETECTIVE - /** - * Memory leak detective, if enabled - */ - leak_detective_t *detective; -#endif /* LEAK_DETECTIVE */ }; /** @@ -81,13 +74,11 @@ void library_deinit() this->public.integrity->destroy(this->public.integrity); } -#ifdef LEAK_DETECTIVE - if (this->detective) + if (lib->leak_detective) { - this->detective->report(this->detective, detailed); - this->detective->destroy(this->detective); + lib->leak_detective->report(lib->leak_detective, detailed); + lib->leak_detective->destroy(lib->leak_detective); } -#endif /* LEAK_DETECTIVE */ threads_deinit(); @@ -106,10 +97,9 @@ bool library_init(char *settings) threads_init(); - lib->leak_detective = FALSE; - + lib->leak_detective = NULL; #ifdef LEAK_DETECTIVE - this->detective = leak_detective_create(); + lib->leak_detective = leak_detective_create(); #endif /* LEAK_DETECTIVE */ pfh = printf_hook_create(); |