mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-26 20:30:59 +01:00
lightningd: final cleanup for plugins.
1. Make the destructor call check_plugins_resolved(), unless it was uninitialized (`opt_disable_plugin`). 2. Remove redundant list_del (destructor already does it). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
80f1f0ca15
commit
20abcd3ba3
1 changed files with 4 additions and 3 deletions
|
@ -113,6 +113,10 @@ static void destroy_plugin(struct plugin *p)
|
|||
call->cmd, PLUGIN_TERMINATED,
|
||||
"Plugin terminated before replying to RPC call."));
|
||||
}
|
||||
|
||||
/* Don't call this if we're still parsing options! */
|
||||
if (p->plugin_state != UNCONFIGURED)
|
||||
check_plugins_resolved(p->plugins);
|
||||
}
|
||||
|
||||
struct plugin *plugin_register(struct plugins *plugins, const char* path TAKES,
|
||||
|
@ -190,14 +194,11 @@ void plugin_kill(struct plugin *plugin, const char *msg)
|
|||
{
|
||||
log_info(plugin->log, "Killing plugin: %s", msg);
|
||||
kill(plugin->pid, SIGKILL);
|
||||
list_del(&plugin->list);
|
||||
|
||||
if (plugin->start_cmd) {
|
||||
plugin_cmd_killed(plugin->start_cmd, plugin, msg);
|
||||
plugin->start_cmd = NULL;
|
||||
}
|
||||
|
||||
check_plugins_resolved(plugin->plugins);
|
||||
tal_free(plugin);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue