Closed
Description
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
Labels
No labels