#495 Access Violation if OPAL library is unloaded before PTLIB library

Development_Branch
closed-works-for-me
nobody
None
5
2014-06-12
2013-11-28
No

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.

Discussion

  • Are you making sure you explicitly destroy the OpalManager and PProcess instances (in that order) before unloading the DLL's?

     
  • I have used the "C" API test program to unload and re-load the DLL's and this all works fine. Please note my previous comment.

     
    • status: open --> closed-works-for-me