From ff197edfc453bb9e65a1f456eb6ad4fc0adcae62 Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Tue, 7 Aug 2018 11:13:48 -0700 Subject: [PATCH] main: reordered plugin init/exit This fixes improper cleanup when ofono leaves the bus after a simauth instance has been cleaned up. The problem was that the plugin exit was being called after the simauth module, causing there to be stale simauth instances that were no longer valid. Now plugins cleanup before simauth. This fix fixes the print seen when iwd exits: "Auth provider queue was not empty on exit!" --- src/main.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main.c b/src/main.c index d599e830..3bc41fd4 100644 --- a/src/main.c +++ b/src/main.c @@ -405,8 +405,6 @@ int main(int argc, char *argv[]) goto done; } - plugin_init(plugins, noplugins); - genl = l_genl_new_default(); if (!genl) { l_error("Failed to open generic netlink socket"); @@ -447,10 +445,12 @@ int main(int argc, char *argv[]) known_networks_init(); rfkill_init(); sim_auth_init(); + plugin_init(plugins, noplugins); exit_status = EXIT_SUCCESS; l_main_run(); + plugin_exit(); sim_auth_exit(); rfkill_exit(); known_networks_exit(); @@ -469,7 +469,6 @@ fail_device: l_genl_unref(genl); fail_genl: - plugin_exit(); dbus_exit(); done: