diff --git a/Modules/Wrappers/QGIS/src/otbQgisDescriptor.cxx b/Modules/Wrappers/QGIS/src/otbQgisDescriptor.cxx
index 4349a77e2d1722475930d76dbcd65a9a3fdf412e..ba56afbd28ec07b812ec4e818e20436f5e384999 100644
--- a/Modules/Wrappers/QGIS/src/otbQgisDescriptor.cxx
+++ b/Modules/Wrappers/QGIS/src/otbQgisDescriptor.cxx
@@ -338,6 +338,10 @@ int main(int argc, char* argv[])
   indexFile << group << "|" << module << std::endl;
   indexFile.close();
   std::cerr << "Updated " << algs_txt << std::endl;
+
+  appli = nullptr;
+  ApplicationRegistry::CleanRegistry();
+
   return EXIT_SUCCESS;
   }