mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
common/daemon: remove notifiers on root at cleanup.
Under some circumstances, valgrind complains. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
ff8830876d
commit
af8eabb9a7
@@ -119,6 +119,12 @@ static void add_steal_notifiers(const tal_t *root)
|
|||||||
for (const tal_t *i = tal_first(root); i; i = tal_next(i))
|
for (const tal_t *i = tal_first(root); i; i = tal_next(i))
|
||||||
add_steal_notifiers(i);
|
add_steal_notifiers(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void remove_steal_notifiers(void)
|
||||||
|
{
|
||||||
|
/* We remove this from root, assuming everything else freed. */
|
||||||
|
tal_del_notifier(NULL, add_steal_notifier);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void daemon_setup(const char *argv0,
|
void daemon_setup(const char *argv0,
|
||||||
@@ -155,6 +161,10 @@ void daemon_setup(const char *argv0,
|
|||||||
void daemon_shutdown(void)
|
void daemon_shutdown(void)
|
||||||
{
|
{
|
||||||
common_shutdown();
|
common_shutdown();
|
||||||
|
|
||||||
|
#if DEVELOPER && BACKTRACE_SUPPORTED
|
||||||
|
remove_steal_notifiers();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void daemon_maybe_debug(char *argv[])
|
void daemon_maybe_debug(char *argv[])
|
||||||
|
|||||||
Reference in New Issue
Block a user