The only user (bfd backtraces) is fine with that, and we really should not
mess the enable flag while doing allocations with other threads.
METHOD(leak_detective_t, set_state, bool,
private_leak_detective_t *this, bool enable)
{
- if (enable == enabled)
- {
- return enabled;
- }
- if (enable)
- {
- enable_leak_detective();
- }
- else
- {
- disable_leak_detective();
- }
- return !enabled;
+ return enable_thread(enable);
}
METHOD(leak_detective_t, usage, void,
void (*usage)(leak_detective_t *this, FILE *out);
/**
- * Enable/disable leak detective hooks.
+ * Enable/disable leak detective hooks for the current thread.
*
* @param TRUE to enable, FALSE to disable
* @return state active before calling set_state
leak_detective_t *leak_detective_create();
#endif /** LEAK_DETECTIVE_H_ @}*/
-