When a Tag is leaving the field, it makes more sense to
unregister its associated records before the Device itself, and not the
other way around.
DBG("path %s", tag->path);
- if (!g_hash_table_lookup(tag_hash, tag->path))
- return;
-
- g_dbus_unregister_interface(connection, tag->path,
- NFC_TAG_INTERFACE);
-
g_hash_table_remove(tag_hash, path);
}
near_ndef_records_free(tag->records);
+ g_dbus_unregister_interface(connection, tag->path,
+ NFC_TAG_INTERFACE);
+
g_free(tag->path);
g_free(tag->data);
g_free(tag);