| 641 | } |
| 642 | |
| 643 | static struct plugin_destroyed * |
| 644 | plugin_detect_destruction(const struct plugin *plugin) |
| 645 | { |
| 646 | struct plugin_destroyed *pd = notleak(tal(NULL, struct plugin_destroyed)); |
| 647 | pd->plugin = plugin; |
| 648 | tal_add_destructor2(plugin, mark_plugin_destroyed, pd); |
| 649 | return pd; |
| 650 | } |
| 651 | |
| 652 | static bool was_plugin_destroyed(struct plugin_destroyed *pd) |
| 653 | { |