Call plugin exit function before unloading
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 25 Feb 2016 17:29:46 +0000 (12:29 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 27 May 2017 16:57:26 +0000 (12:57 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
lib/plugin-system/plugin.c

index 9f57db226a1eaa6f0a9081eaeaf1d3d41e1fba5c..8bc0fc09c3f049af24ed1c854a08012afdc8baa8 100644 (file)
@@ -46,6 +46,10 @@ void bt_plugin_destroy(struct bt_object *obj)
        assert(obj);
        plugin = container_of(obj, struct bt_plugin, base);
 
+       if (plugin->exit) {
+               plugin->exit();
+       }
+
        if (plugin->module) {
                if (!g_module_close(plugin->module)) {
                                printf_error("Module close error: %s",
@@ -53,9 +57,6 @@ void bt_plugin_destroy(struct bt_object *obj)
                }
        }
 
-       if (plugin->exit) {
-               plugin->exit();
-       }
        g_string_free(plugin->path, TRUE);
        g_free(plugin);
 }
This page took 0.029255 seconds and 4 git commands to generate.