0027318: Memory is not released in Select3D_SensitiveSet when destroying AIS_Interact...
[occt.git] / src / SelectMgr / SelectMgr_SelectableObject.cxx
index 6a96a33..bb6260d 100644 (file)
@@ -69,6 +69,17 @@ SelectMgr_SelectableObject::SelectMgr_SelectableObject (const PrsMgr_TypeOfPrese
   myHilightDrawer->Link (myDrawer);
 }
 
+//==================================================
+// Function: Destructor
+// Purpose : Clears all selections of the object
+//==================================================
+SelectMgr_SelectableObject::~SelectMgr_SelectableObject()
+{
+  for (Standard_Integer aSelIdx = 1; aSelIdx <= myselections.Length(); ++aSelIdx)
+  {
+    myselections.Value (aSelIdx)->Clear();
+  }
+}
 
 //==================================================
 // Function: HasSelection