memleak: remove exclusions from memleak_start()

Add memleak_ignore_children() so callers can do exclusions themselves.

Having two exclusions was always such a hack!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2022-09-16 12:45:03 +09:30
parent 3380f559f9
commit 701dd3dcef
14 changed files with 48 additions and 34 deletions

View File

@@ -1350,7 +1350,11 @@ static void memleak_check(struct plugin *plugin, struct command *cmd)
{
struct htable *memtable;
memtable = memleak_start(tmpctx, cmd, cmd);
memtable = memleak_start(tmpctx);
/* cmd in use right now */
memleak_ptr(memtable, cmd);
memleak_ignore_children(memtable, cmd);
/* Now delete plugin and anything it has pointers to. */
memleak_scan_obj(memtable, plugin);