Skip to content

atexit() called after setup() #1919

Closed
Closed
@cider101

Description

@cider101

First of all, there is no atexit() definition provieded by the runtime-environment which gives you, in case of "stack-based" singleton implementation - undefined references while linking.
class Singleton {
static Signleton& instance() { static Signleton theInstance; return theInstance; }
};
Secondly, the atexit is called after leaving setup() - which if implemented correctly - will just delete the instance and leave you with invalid memory!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions