comparison 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
comparison
equal deleted inserted replaced
1039:d0e6dd5af46e 1040:2b4fd440399d
159 for (j = 0; j < listener->nsocks; j++) { 159 for (j = 0; j < listener->nsocks; j++) {
160 close(listener->socks[j]); 160 close(listener->socks[j]);
161 } 161 }
162 ses.listeners[listener->index] = NULL; 162 ses.listeners[listener->index] = NULL;
163 m_free(listener); 163 m_free(listener);
164 }
164 165
166 void remove_all_listeners(void) {
167 unsigned int i;
168 for (i = 0; i < ses.listensize; i++) {
169 if (ses.listeners[i]) {
170 remove_listener(ses.listeners[i]);
171 }
172 }
173 m_free(ses.listeners);
165 } 174 }