1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +03:00

0031944: Foundation Classes, Message_Report - add missing mutex locks for message level

This commit is contained in:
nds 2020-10-31 22:58:22 +03:00 committed by bugmaster
parent 0177fe2617
commit 38b336df80

View File

@ -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();
}