@@ -82,7 +82,12 @@ static bool getParameterTraceEnable()
82
82
static int param_maxRegionDepthOpenCV = (int )utils::getConfigurationParameterSizeT(" OPENCV_TRACE_DEPTH_OPENCV" , 1 );
83
83
static int param_maxRegionChildrenOpenCV = (int )utils::getConfigurationParameterSizeT(" OPENCV_TRACE_MAX_CHILDREN_OPENCV" , 1000 );
84
84
static int param_maxRegionChildren = (int )utils::getConfigurationParameterSizeT(" OPENCV_TRACE_MAX_CHILDREN" , 10000 );
85
- static cv::String param_traceLocation = utils::getConfigurationParameterString(" OPENCV_TRACE_LOCATION" , " OpenCVTrace" );
85
+
86
+ static const cv::String& getParameterTraceLocation ()
87
+ {
88
+ static cv::String param_traceLocation = utils::getConfigurationParameterString (" OPENCV_TRACE_LOCATION" , " OpenCVTrace" );
89
+ return param_traceLocation;
90
+ }
86
91
87
92
#ifdef HAVE_OPENCL
88
93
static bool param_synchronizeOpenCL = utils::getConfigurationParameterBool(" OPENCV_TRACE_SYNC_OPENCL" , false );
@@ -813,7 +818,7 @@ TraceStorage* TraceManagerThreadLocal::getStorage() const
813
818
TraceStorage* global = getTraceManager ().trace_storage .get ();
814
819
if (global)
815
820
{
816
- const std::string filepath = cv::format (" %s-%03d.txt" , param_traceLocation .c_str (), threadID).c_str ();
821
+ const std::string filepath = cv::format (" %s-%03d.txt" , getParameterTraceLocation () .c_str (), threadID).c_str ();
817
822
TraceMessage msg;
818
823
const char * pos = strrchr (filepath.c_str (), ' /' ); // extract filename
819
824
#ifdef _WIN32
@@ -848,7 +853,7 @@ TraceManager::TraceManager()
848
853
activated = getParameterTraceEnable ();
849
854
850
855
if (activated)
851
- trace_storage.reset (new SyncTraceStorage (std::string (param_traceLocation ) + " .txt" ));
856
+ trace_storage.reset (new SyncTraceStorage (std::string (getParameterTraceLocation () ) + " .txt" ));
852
857
853
858
#ifdef OPENCV_WITH_ITT
854
859
if (isITTEnabled ())
0 commit comments