diff --git a/Modules/Core/Common/include/otbLogger.h b/Modules/Core/Common/include/otbLogger.h index d252a93d3116f3d132698dd0dd96c363b82e1e12..ef420c7b2389a38af6be6d1f7cf19faaa4b7f1b5 100644 --- a/Modules/Core/Common/include/otbLogger.h +++ b/Modules/Core/Common/include/otbLogger.h @@ -44,6 +44,14 @@ public: itkTypeMacro(Logger, itk::Logger); + /** + * If Logger crashes when called from the destructor of a static + * or global object, the singleton might have already been destroyed. + * You can prolong its lifetime by calling Logger::Instance() + * from that object's constructor. + * + * See https://stackoverflow.com/questions/335369/finding-c-static-initialization-order-problems#335746 + */ static Pointer Instance(); itkNewMacro(Self);