about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2012-10-16 23:34:38 +0100
committerJames Booth <boothj5@gmail.com>2012-10-16 23:34:38 +0100
commit2f66feef8a17f3508c09049c3d78e7f4746a85ef (patch)
tree063872aa7a134c90991652df6a9ee041b67dff7b /src
parentd2aeca9bb4517658e22529168c17d789db9dab43 (diff)
parent6900d52d805149977d2f2ff0f8c2433169f21e31 (diff)
downloadprofani-tty-2f66feef8a17f3508c09049c3d78e7f4746a85ef.tar.gz
Merge branch 'master' of https://github.com/pasis/profanity
Diffstat (limited to 'src')
-rw-r--r--src/jabber.c8
-rw-r--r--src/jabber.h1
-rw-r--r--src/profanity.c1
3 files changed, 10 insertions, 0 deletions
diff --git a/src/jabber.c b/src/jabber.c
index 64d33666..6b16e16d 100644
--- a/src/jabber.c
+++ b/src/jabber.c
@@ -254,6 +254,14 @@ jabber_get_jid(void)
     return xmpp_conn_get_jid(jabber_conn.conn);
 }
 
+void
+jabber_free_resources(void)
+{
+	xmpp_conn_release(jabber_conn.conn);
+	xmpp_ctx_free(jabber_conn.ctx);
+	xmpp_shutdown();
+}
+
 static int
 _message_handler(xmpp_conn_t * const conn, 
     xmpp_stanza_t * const stanza, void * const userdata)
diff --git a/src/jabber.h b/src/jabber.h
index f9ad7fb6..84483c79 100644
--- a/src/jabber.h
+++ b/src/jabber.h
@@ -51,5 +51,6 @@ void jabber_send(const char * const msg, const char * const recipient);
 void jabber_update_presence(jabber_presence_t status, const char * const msg);
 const char * jabber_get_jid(void);
 jabber_conn_status_t jabber_get_connection_status(void);
+void jabber_free_resources(void);
 
 #endif
diff --git a/src/profanity.c b/src/profanity.c
index 002b2453..2c652b3b 100644
--- a/src/profanity.c
+++ b/src/profanity.c
@@ -283,6 +283,7 @@ _shutdown_init(void)
         }
         jabber_shutdown();
     }
+    jabber_free_resources();
 
     _shutdown();
 }