Oso Memory Profiler

4.2 - OsoMP_Closedown

Flushes all cached profile data, and closes any open network connection.

Any profile events generated after calling this function may be lost.

void OsoMP_Closedown( void );
While you obviously can call this function at any time, it is highly recommended it only be called during your application's shutdown procedure.

For Windows applications built with Visual Studio, the recommended way to call this function and terminate the process is with this code at the end of the main/WinMain function:

    _cexit();             // Call global destructors, and clean up the runtime library.
    OsoMP_Closedown();    // Flush any lingering profile data, and stop the profiler.
    ExitProcess( 0 );     // Return control to the OS for final process cleanup.

If you are building with clang or gcc, you don't need to call this function explicitly. It will be called automatically by the compiler after global destructors have been called. For the curious reader, it is declared as follows for these compilers:

__attribute__((destructor)) void OsoMP_Closedown( void );