common/utils: don't free tmpctx, just the children.

In some daemons I want to hand it into a loop, which would call
clean_tmpctx().  This causes a subtle bug.

So just free the children directly: the pointer itself remains valid.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2018-08-02 16:19:22 +09:30
parent 2d1190d929
commit 4bdacea7b5
2 changed files with 6 additions and 8 deletions

View File

@@ -22,7 +22,7 @@ u8 *tal_hexdata(const tal_t *ctx, const void *str, size_t len);
/* Use the POSIX C locale. */
void setup_locale(void);
/* Global temporary convenience context: freed in io loop core. */
/* Global temporary convenience context: children freed in io loop core. */
extern const tal_t *tmpctx;
/* Initial creation of tmpctx. */