From: Tobias Ulmer Date: Wed, 26 Jun 2019 15:50:14 +0000 (+0200) Subject: plugin: deinitialize plugins in reverse order X-Git-Tag: e2factory-2.3.18rc4~3 X-Git-Url: https://git.e2factory.org/?a=commitdiff_plain;h=7d1dfce4d29ae5223b446f4bd1d6e388fad917b6;p=e2factory.git plugin: deinitialize plugins in reverse order Signed-off-by: Tobias Ulmer --- diff --git a/generic/plugin.lua b/generic/plugin.lua index c895dd2..65bc2f0 100644 --- a/generic/plugin.lua +++ b/generic/plugin.lua @@ -241,13 +241,15 @@ end -- @return an error object on failure function plugin.exit_plugins() local e = err.new("deinitializing plugins failed") - for _, pd in ipairs(plugins) do + while #plugins > 0 do + local pd = table.remove(plugins) -- deinitialize in reverse order + e2lib.logf(4, "de-init plugin %s", pd.file) local rc, re = pd.exit(pd.ctx) if not rc then return false, e:cat(re) end end - return true, nil + return true end --- print a description for each plugin. This is for use with the --version