From: nds Date: Sat, 31 Oct 2020 19:58:22 +0000 (+0300) Subject: 0031944: Foundation Classes, Message_Report - add missing mutex locks for message... X-Git-Tag: V7_6_0_beta~342 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=38b336df800651e9bfa4d8eddd5edde67e0b2fc0;p=occt.git 0031944: Foundation Classes, Message_Report - add missing mutex locks for message level --- diff --git a/src/Message/Message_Report.cxx b/src/Message/Message_Report.cxx index 2a0c458367..d8ed266198 100644 --- a/src/Message/Message_Report.cxx +++ b/src/Message/Message_Report.cxx @@ -185,6 +185,8 @@ void Message_Report::UpdateActiveInMessenger (const Handle(Message_Messenger)& t //======================================================================= void Message_Report::AddLevel (Message_Level* theLevel, const TCollection_AsciiString& theName) { + Standard_Mutex::Sentry aSentry (myMutex); + myAlertLevels.Append (theLevel); Handle(Message_AlertExtended) aLevelRootAlert = new Message_AlertExtended(); @@ -220,6 +222,8 @@ void Message_Report::AddLevel (Message_Level* theLevel, const TCollection_AsciiS void Message_Report::RemoveLevel (Message_Level* theLevel) { + Standard_Mutex::Sentry aSentry (myMutex); + for (int aLevelIndex = myAlertLevels.Size(); aLevelIndex >= 1; aLevelIndex--) { Message_Level* aLevel = myAlertLevels.Value (aLevelIndex); @@ -247,6 +251,8 @@ void Message_Report::Clear() return; } + Standard_Mutex::Sentry aSentry (myMutex); + compositeAlerts()->Clear(); myAlertLevels.Clear(); } @@ -262,6 +268,8 @@ void Message_Report::Clear (Message_Gravity theGravity) return; } + Standard_Mutex::Sentry aSentry (myMutex); + compositeAlerts()->Clear (theGravity); myAlertLevels.Clear(); } @@ -277,6 +285,8 @@ void Message_Report::Clear (const Handle(Standard_Type)& theType) return; } + Standard_Mutex::Sentry aSentry (myMutex); + compositeAlerts()->Clear (theType); myAlertLevels.Clear(); }