+void bt_unregister_format(struct bt_format *format)
+{
+ assert(bt_lookup_format(format->name));
+ g_hash_table_remove(format_registry,
+ (gpointer) (unsigned long) format->name);
+ format_refcount_dec();
+}
+
+/*
+ * We cannot assume that the constructor and destructor order will be
+ * right: another library might be loaded before us, and initialize us
+ * from bt_register_format(). This is why we use a reference count to
+ * handle cleanup of this module. The format_finalize destructor
+ * refcount decrement matches format_init refcount increment.
+ */
+static __attribute__((constructor))