diff --git a/modules/core/src/logger.cpp b/modules/core/src/logger.cpp index 7dd6f93817..dbb25f9e09 100644 --- a/modules/core/src/logger.cpp +++ b/modules/core/src/logger.cpp @@ -94,8 +94,7 @@ LogLevel GlobalLoggingInitStruct::m_defaultUnconfiguredGlobalLevel = GlobalLoggi // static GlobalLoggingInitStruct& getGlobalLoggingInitStruct() { - static GlobalLoggingInitStruct globalLoggingInitInstance; - return globalLoggingInitInstance; + CV_SINGLETON_LAZY_INIT_REF(GlobalLoggingInitStruct, new GlobalLoggingInitStruct()); } // To ensure that the combined struct defined above is initialized even diff --git a/platforms/scripts/valgrind.supp b/platforms/scripts/valgrind.supp index 1fa1fff688..10ea856e9d 100644 --- a/platforms/scripts/valgrind.supp +++ b/platforms/scripts/valgrind.supp @@ -218,6 +218,13 @@ fun:__itt_*create* } +{ + OpenCV-SingletonLogger + Memcheck:Leak + ... + fun:_ZN2cv5utils7logging8internalL26getGlobalLoggingInitStructEv +} + { OpenCV-gtk_init Memcheck:Leak