diff listener.c @ 1040:2b4fd440399d

Free memory before exiting. Based on patch from Thorsten Horstmann. Client side is not complete.
author Matt Johnston <matt@ucc.asn.au>
date Tue, 24 Feb 2015 22:01:33 +0800
parents 0cfba3034be5
children 06d52bcb8094
line wrap: on
line diff
--- a/listener.c	Tue Feb 24 20:53:32 2015 +0800
+++ b/listener.c	Tue Feb 24 22:01:33 2015 +0800
@@ -161,5 +161,14 @@
 	}
 	ses.listeners[listener->index] = NULL;
 	m_free(listener);
+}
 
+void remove_all_listeners(void) {
+	unsigned int i;
+	for (i = 0; i < ses.listensize; i++) {
+		if (ses.listeners[i]) {
+			remove_listener(ses.listeners[i]);
+		}
+	}
+	m_free(ses.listeners);
 }