| 2264 | } |
| 2265 | |
| 2266 | void BfSystem::ProcessAtomGraveyard() |
| 2267 | { |
| 2268 | // We need this set, as it's possible to have multiple of the same entry in the graveyard |
| 2269 | // if we ref and then deref again |
| 2270 | HashSet<BfAtom*> deletedAtoms; |
| 2271 | |
| 2272 | for (auto atom : mAtomGraveyard) |
| 2273 | { |
| 2274 | if (deletedAtoms.Contains(atom)) |
| 2275 | continue; |
| 2276 | |
| 2277 | BF_ASSERT(atom->mRefCount >= 0); |
| 2278 | if (atom->mRefCount == 0) |
| 2279 | { |
| 2280 | deletedAtoms.Add(atom); |
| 2281 | auto itr = mAtomMap.Remove(atom->mString); |
| 2282 | free((void*)atom->mString.mPtr); |
| 2283 | delete atom; |
| 2284 | } |
| 2285 | } |
| 2286 | mAtomGraveyard.Clear(); |
| 2287 | } |
| 2288 | |
| 2289 | bool BfSystem::ParseAtomComposite(const StringView& name, BfAtomComposite& composite, bool addRefs) |
| 2290 | { |