Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/majn/tgl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormjentsch <mtthsjntsch@gmail.com>2015-10-05 13:37:34 +0300
committermjentsch <mtthsjntsch@gmail.com>2015-10-05 13:37:34 +0300
commit4f00738bd2e074bf8a7d5977082a8f467210df48 (patch)
tree386595f81a21a7e381d86e2b1be6e711be46bc81
parente092552313bcb97755c550552baa62b531b95203 (diff)
Free channels on cleanuppull-request-clean-channels
-rw-r--r--structures.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/structures.c b/structures.c
index 9dc9876..964ccc2 100644
--- a/structures.c
+++ b/structures.c
@@ -2036,6 +2036,15 @@ void tgls_free_encr_chat (struct tgl_state *TLS, struct tgl_secret_chat *U) {
tfree (U, sizeof (*U));
}
+void tgls_free_channel (struct tgl_state *TLS, struct tgl_channel *U) {
+ if (U->print_title) { tfree_str (U->print_title); }
+ if (U->username) { tfree_str (U->username); }
+ if (U->title) { tfree_str (U->title); }
+ if (U->about) { tfree_str (U->about); }
+ if (U->photo) { tgls_free_photo (TLS, U->photo); }
+ tfree (U, sizeof (*U));
+}
+
void tgls_free_peer (struct tgl_state *TLS, tgl_peer_t *P) {
if (tgl_get_peer_type (P->id) == TGL_PEER_USER) {
tgls_free_user (TLS, (void *)P);
@@ -2043,6 +2052,8 @@ void tgls_free_peer (struct tgl_state *TLS, tgl_peer_t *P) {
tgls_free_chat (TLS, (void *)P);
} else if (tgl_get_peer_type (P->id) == TGL_PEER_ENCR_CHAT) {
tgls_free_encr_chat (TLS, (void *)P);
+ } else if (tgl_get_peer_type (P->id) == TGL_PEER_CHANNEL) {
+ tgls_free_channel (TLS, (void *)P);
} else {
assert (0);
}