E-MailRelay

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Static Public Member Functions | List of all members
G::Cleanup Class Reference

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...

## Detailed Description

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.

## Member Function Documentation

void G::Cleanup::add | ( | void(*)(SignalSafe, const char *) | fn,
|  | const char * | arg
| ) |  |
| 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.

void G::Cleanup::atexit | ( | bool | active = `true` | ) |
| 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.

The documentation for this class was generated from the following files:

- /tmp/slackrepo/SBo/slackrepo.S3SYfd/build_emailrelay/emailrelay-2.0.1/src/glib/gcleanup.h
- /tmp/slackrepo/SBo/slackrepo.S3SYfd/build_emailrelay/emailrelay-2.0.1/src/glib/gcleanup_unix.cpp