diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplicationRegistry.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplicationRegistry.cxx
index b6ac088ab43e2b375132c28a4a6e1208226007df..ea668936fe0b9d70de53a3190e8d14fa8f88d365 100644
--- a/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplicationRegistry.cxx
+++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplicationRegistry.cxx
@@ -94,6 +94,10 @@ public:
   /** close all handles at program exit */
   ~ApplicationPrivateRegistry()
   {
+  // unregister all ITK factories, because some of them could have been
+  // registered by the shared libs we are about to close.
+  itk::ObjectFactoryBase::UnRegisterAllFactories();
+  // Close all opened shared libs
   AppHandleContainerType::iterator it;
   for (it = m_Container.begin() ; it != m_Container.end() ; ++it)
     {