1
Answer

static destructor?

Ask a question
Administrator

Administrator

21y
1.4k
1
I have an abstract class comprised solely of static methods and data members. I have implemented a static constructor to init the object upon the first call or use of any of its static members. There is one operation I need to perform upon destruction of the purely static object and nothing I've done seems to work. Implementing IDispose or writing a destructor don't work since there is never an instance of the object. I haven't found a static destructor either. Does anyone have any suggestions on how to execute code on the destruction of a purely static object? Is there such a thing as a static destructor?

Answers (1)