diff --git a/Modules/Applications/AppDomainTransform/app/otbDomainTransform.cxx b/Modules/Applications/AppDomainTransform/app/otbDomainTransform.cxx
index 2fcc91e6aebf5a9c465c339e4715c828b2a89d53..3e791c67826b93a072c48eb1a1b91b6721eb41e4 100644
--- a/Modules/Applications/AppDomainTransform/app/otbDomainTransform.cxx
+++ b/Modules/Applications/AppDomainTransform/app/otbDomainTransform.cxx
@@ -75,6 +75,22 @@ public:
   itkTypeMacro(Self, otb::Application);
 
 private:
+  DomainTransform() {}
+
+  ~DomainTransform() ITK_OVERRIDE
+    {
+    // This is a trick to make sure fftw will cleanup its threads when application
+    // shared lib is released.
+    #if defined(ITK_USE_FFTWF)
+      fftwf_cleanup_threads();
+      fftwf_cleanup();
+    #endif
+    #if defined(ITK_USE_FFTWD)
+      fftw_cleanup_threads();
+      fftw_cleanup();
+    #endif
+    }
+
   void DoInit() ITK_OVERRIDE
     {
     SetName("DomainTransform");