Detach the AutoLocker before deleting the locked object.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29431 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2009-03-07 22:26:53 +00:00
parent 4edbdca09e
commit 0f90efc3bf
@@ -346,13 +346,15 @@ Volume::Unmount()
status_t error = _Unmount();
// free the memory associated with the vnode count map
if (fVNodeCountMap) {
AutoLocker<VNodeCountMap> _(fVNodeCountMap);
AutoLocker<VNodeCountMap> locker(fVNodeCountMap);
fVNodeCountingEnabled = false;
for (VNodeCountMap::Iterator it = fVNodeCountMap->GetIterator();
it.HasNext();) {
VNodeCountMap::Entry entry = it.Next();
delete entry.value;
}
locker.Detach();
delete fVNodeCountMap;
fVNodeCountMap = NULL;
}