aboutsummaryrefslogtreecommitdiffstats
path: root/libcontacts_contact_destroy.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2021-04-02 13:17:25 +0200
committerMattias Andrée <maandree@kth.se>2021-04-02 13:21:07 +0200
commit8b52cc7243c2e0e4ef17db5583999030b8636584 (patch)
tree29d4985285ecbbce2c7ec1cf61837ede3fccf526 /libcontacts_contact_destroy.c
downloadlibcontacts-8b52cc7243c2e0e4ef17db5583999030b8636584.tar.gz
libcontacts-8b52cc7243c2e0e4ef17db5583999030b8636584.tar.bz2
libcontacts-8b52cc7243c2e0e4ef17db5583999030b8636584.tar.xz
First commit
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--libcontacts_contact_destroy.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/libcontacts_contact_destroy.c b/libcontacts_contact_destroy.c
new file mode 100644
index 0000000..ef208d5
--- /dev/null
+++ b/libcontacts_contact_destroy.c
@@ -0,0 +1,25 @@
+/* See LICENSE file for copyright and license details. */
+#include "common.h"
+
+
+void
+libcontacts_contact_destroy(struct libcontacts_contact *this)
+{
+ free(this->id);
+ free(this->name);
+ free(this->first_name);
+ free(this->last_name);
+ free(this->nickname);
+ DESTROY_ALL(this->photos, free);
+ DESTROY_ALL(this->groups, free);
+ free(this->notes);
+ DESTROY_ALL(this->organisations, libcontacts_organisation_destroy);
+ DESTROY_ALL(this->emails, libcontacts_email_destroy);
+ DESTROY_ALL(this->pgpkeys, libcontacts_pgpkey_destroy);
+ DESTROY_ALL(this->numbers, libcontacts_number_destroy);
+ DESTROY_ALL(this->addresses, libcontacts_address_destroy);
+ DESTROY_ALL(this->sites, libcontacts_site_destroy);
+ DESTROY_ALL(this->chats, libcontacts_chat_destroy);
+ libcontacts_birthday_destroy(this->birthday);
+ DESTROY_ALL(this->unrecognised_data, free);
+}