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!"
This commit is contained in:
James Prestwood 2018-08-07 11:13:48 -07:00 committed by Denis Kenzior
parent 8102b33634
commit ff197edfc4
1 changed files with 2 additions and 3 deletions

View File

@ -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: