mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0024276: Memory leak due to a static variable
Cleaning of selected entities to avoid a memory leak.
This commit is contained in:
@@ -50,9 +50,10 @@
|
||||
#define MaxSizeOfResult 100000
|
||||
#endif
|
||||
|
||||
//current selection (handle)
|
||||
static Handle(AIS_Selection) theCurrentSelection;
|
||||
static void AIS_Sel_CurrentSelection (Handle(AIS_Selection)& InputSel)
|
||||
{
|
||||
static Handle(AIS_Selection) theCurrentSelection;
|
||||
if(!InputSel.IsNull())
|
||||
theCurrentSelection = InputSel;
|
||||
else
|
||||
@@ -418,6 +419,11 @@ void AIS_Selection::Remove(const Standard_CString aName)
|
||||
#endif
|
||||
AIS_Sel_GetSelections().Remove(I);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// clean the static current selection handle
|
||||
void AIS_Selection::ClearCurrentSelection()
|
||||
{
|
||||
theCurrentSelection.Nullify();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user