Static initializer destruction crash, maybe?

I’ve got a hard to reproduce crash in a plugin, but one of my customers can do it all the time.

It’s a crash on shutdown. We have some static objects, which in turn have a SharedResourcePointer<> to something that uses timer.

I’m thinking this is probably a problem as the timer lock is a static object, and so we maybe have a pretty undefined order as to whether the timer lock or our static object is going to be deleted first.

So maybe hooking DeletedAtShutdown and having that tidy up should fix this, as I assume that’ll happen before we get into deleting static objects?

Also I’m slightly surprised we didn’t see this at our end, as I’d have thought that static object destruction order was something set up by the linker, not the loader on the customers system?