tal: allow notifiers on NULL.
authorRusty Russell <rusty@rustcorp.com.au>
Thu, 23 Aug 2018 02:41:13 +0000 (12:11 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Thu, 23 Aug 2018 02:41:13 +0000 (12:11 +0930)
commita8722345053b7cd860499aa31fd6bb414c120cc8
tree97e657e9a5dc5f6a02c1a142410bf86f077cd7d6
parentd1a951b82386391b82e48b32403891f85e253565
tal: allow notifiers on NULL.

A destructor on NULL doesn't make sense, but notifiers (eg. new children)
do.  We fix up a mistake in run-notifier (comparing ctx with itself) and
loose typing in tal.c's tal_add_notifier_ too.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ccan/tal/tal.c
ccan/tal/tal.h
ccan/tal/test/run-notifier.c