Skip to content

Equivalent to Python atexit functionality #712

@steveklabnik

Description

@steveklabnik

Issue by bmurphy1976
Tuesday Jan 21, 2014 at 01:54 GMT

For earlier discussion, see rust-lang/rust#11695

This issue was labelled with: in the Rust repository


I can't always guarantee that users are going to properly use a library (calling init methods, cleanup methods, etc.).

Occasionally things die horribly and you want to provide stronger guarantees about when things fail.

Is there a way to hook up to an exit signal of sorts to execute code when a program exits regardless of the exit mechanism? Something like Python atexit?

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-libs-apiRelevant to the library API team, which will review and decide on the RFC.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions