lib: plugin: reset pointers to `NULL` on destruction
[babeltrace.git] / lib / plugin / plugin-so.c
index b875ad68953598b5a2217977e96725d3e136d54f..357a4ccd6feffa911007366fb7755fcecd148e7b 100644 (file)
@@ -148,6 +148,8 @@ void bt_plugin_so_shared_lib_handle_destroy(struct bt_object *obj)
                                BT_LOGE("Cannot close GModule: %s: path=\"%s\"",
                                        g_module_error(), path);
                        }
+
+                       shared_lib_handle->module = NULL;
 #ifndef NDEBUG
                } else {
                        BT_LOGD("Not closing GModule because `BABELTRACE_NO_DLCLOSE=1`: "
@@ -158,6 +160,7 @@ void bt_plugin_so_shared_lib_handle_destroy(struct bt_object *obj)
 
        if (shared_lib_handle->path) {
                g_string_free(shared_lib_handle->path, TRUE);
+               shared_lib_handle->path = NULL;
        }
 
        g_free(shared_lib_handle);
This page took 0.022805 seconds and 4 git commands to generate.