|
@@ -1741,10 +1741,13 @@ tor_init(int argc, char *argv[])
|
|
|
}
|
|
|
|
|
|
|
|
|
- * Helps us find the real leaks with dmalloc and the like.
|
|
|
+ * If <b>postfork</b>, we are a worker process and we want to free
|
|
|
+ * only the parts of memory that we won't touch. If !<b>postfork</b>,
|
|
|
+ * Tor is shutting down and we should free everything.
|
|
|
*
|
|
|
- * Also valgrind should then report 0 reachable in its
|
|
|
- * leak report */
|
|
|
+ * Helps us find the real leaks with dmalloc and the like. Also valgrind
|
|
|
+ * should then report 0 reachable in its leak report (in an ideal world --
|
|
|
+ * in practice libevent, ssl, libc etc never quite free everything). */
|
|
|
void
|
|
|
tor_free_all(int postfork)
|
|
|
{
|
|
@@ -1772,13 +1775,14 @@ tor_free_all(int postfork)
|
|
|
free_cell_pool();
|
|
|
tor_tls_free_all();
|
|
|
|
|
|
+ smartlist_free(connection_array);
|
|
|
smartlist_free(closeable_connection_lst);
|
|
|
smartlist_free(active_linked_connection_lst);
|
|
|
tor_free(timeout_event);
|
|
|
|
|
|
escaped(NULL);
|
|
|
if (!postfork) {
|
|
|
- close_logs();
|
|
|
+ logs_free_all();
|
|
|
}
|
|
|
}
|
|
|
|