void VWallmarkManager::OnZoneUnloading(VisZoneResource_cl *pZone) { // zone is to be unloaded: filter out primitives with that zone reference const int iWallmarkCount = m_AllProjectedWallmarks.Count(); for (int i=0;i<iWallmarkCount;i++) { VProjectedWallmark *pProjWallmark = m_AllProjectedWallmarks.GetAt(i); VisStaticGeometryInstanceCollection_cl &wmGiList = pProjWallmark->m_GeoInstanceList; const int iNum = wmGiList.GetNumEntries(); for (int j=0;j<iNum;j++) { VisStaticGeometryInstance_cl *pInst = wmGiList.GetEntry(j); if (pInst->GetParentZone()==pZone) wmGiList.FlagForRemoval(j); } wmGiList.RemoveFlagged(); } }