VideoTools
|
A static interface for registering cleanup functions that are called when the process terminates abnormally. More...
#include <gcleanup.h>
Static Public Member Functions | |
static void | init () |
An optional early-initialisation function. May be called more than once. | |
static void | add (void(*fn)(SignalSafe, const char *), const char *arg) |
Adds the given handler to the list of handlers that are to be called when the process terminates abnormally. More... | |
static void | atexit (bool active=true) |
Ensures that the cleanup functions are also called via atexit(), in addition to abnormal-termination signals. More... | |
A static interface for registering cleanup functions that are called when the process terminates abnormally.
On unix this relates to signals like SIGTERM, SIGINT etc.
Definition at line 39 of file gcleanup.h.
|
static |
Adds the given handler to the list of handlers that are to be called when the process terminates abnormally.
The handler function must be fully reentrant, hence the SignalSafe dummy parameter. The 'arg' pointer is kept.
Definition at line 103 of file gcleanup_unix.cpp.
|
static |
Ensures that the cleanup functions are also called via atexit(), in addition to abnormal-termination signals.
This can be useful when third-party library code (eg. Xlib) might call exit() (grrr). But be careful to call atexit(false) before normal termination, returning from main().
Definition at line 108 of file gcleanup_unix.cpp.