I have an application that depends on PTLIB.
This application loads library (with LoadLibrary) that depends on PTLIB and OPAL libraries.
Then the application unloads library (with FreeLibrary), so the OPAL library is unloaded too.
When the application terminates it tries to destroy it's PProcess and calls PProcess::PostShutdown() -> PFactoryBase::GetFactories().DestroySingletons().
But there are factories registered by the OPAL library, and it has been unloaded already, so "it->second->DestroySingletons();" call causes an Access Violation.
I think it's a bug because OPAL library doesn't unregister (neither implicitly, nor explicitly) registered by itself factories.