Tor  0.4.7.0-alpha-dev
Functions
shutdown.h File Reference

Header file for shutdown.c. More...

Go to the source code of this file.

Functions

void tor_cleanup (void)
 
void tor_free_all (int postfork)
 

Detailed Description

Header file for shutdown.c.

Definition in file shutdown.h.

Function Documentation

◆ tor_cleanup()

void tor_cleanup ( void  )

Do whatever cleanup is necessary before shutting Tor down.

Definition at line 58 of file shutdown.c.

◆ tor_free_all()

void tor_free_all ( int  postfork)

Free all memory that we might have allocated somewhere. If postfork, we are a worker process and we want to free only the parts of memory that we won't touch. If !postfork, Tor is shutting down and we should free everything.

Helps us find the real leaks with sanitizers 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).

Definition at line 109 of file shutdown.c.

Referenced by tor_cleanup().