I have a class in which I implement the singelton design pattern. I know some people don\'t think its a good idea, but it helps a lot,
Anyway - I have a memory leak
One common way of implementing singleton in C++ is making the instance a function-static std::unique_ptr
inside the instance getter, rather than a class-static variable. This ensures a call of destructor upon program's completion, and lets you create an instance that gets accessed polymorphically e.g. through a pointer to an abstract base class.
Scott Meyers provided a good discussion of this topic in his "More Effective C++" book.