Refactor some potentially unsafe SharedPtr<> code.

This commit is contained in:
Adam Ierymenko 2018-04-06 08:10:34 -07:00
parent 40a9ebd078
commit 74f2b78c04
3 changed files with 9 additions and 22 deletions

View file

@ -388,7 +388,7 @@ void Topology::doPeriodicTasks(void *tPtr,int64_t now)
Path::HashKey *k = (Path::HashKey *)0;
SharedPtr<Path> *p = (SharedPtr<Path> *)0;
while (i.next(k,p)) {
if (p->reclaimIfWeak())
if (p->references() <= 1)
_paths.erase(*k);
}
}