I have some code that is in a c++ destructor, but I want it to do something different than normal if it is being destructed due to application exiting as opposed to a regular destruction.
Is there a way to do this?
More info: I have a logger object that if already destructed won't be able to log, though in the destructor for another object, it makes a logging call. I figure if in destruction, I can just skip log calls or reopen the logger if needed. This question is based off an inability to control the order of destruction. If the logger was destructed last, I wouldn't have this problem.
More Info 2: This application is actually less of an application and more of a dll loaded into another application. Though optimally a solution would work with exes and dlls.