Before I get flamed too badly, yes I know there isn't a C++ static destructor.

What I'm after is a technique to clean-up after a class that consists entirely of static member functions and static data. The class maintains a vector of class pointers in its private area. I want the ability to guarantee that the vector is emptied and the class pointers are deleted (hence calling the class' destructors).

The class is actually in a Windows DLL, so I guess there is a function that is called when a DLL is unloaded? If so, I could call a static pseudo-destructor of my own design to clean-up?

I know the memory would be free'd anyway when the DLL unloads, but I wanted a more elegant solution.

I was toying with the idea of a singleton model, but the class is really a wrapper for a whole set of utility functions and I think a singleton model is probably overboard.