[][src]Attribute Macro ctor::dtor

#[dtor]

Marks a function as a library/executable destructor. This uses OS-specific linker sections to call a specific function at termination time.

Only available on Linux and OSX right now.

Multiple shutdown functions are supported, but the invocation order is not guaranteed.

sys_common::at_exit is usually a better solution for shutdown handling, as it allows you to use stdout in your handlers.

#[dtor]
fn shutdown() {
  /* ... */
}