* Only remove the block cache from the list, and its low resource handler when

this is actually needed.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27060 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2008-08-19 11:30:14 +00:00
parent c56a21ed62
commit a1f34e7e89
1 changed files with 7 additions and 5 deletions

View File

@ -803,13 +803,15 @@ block_cache::~block_cache()
{ {
deleting = true; deleting = true;
mutex_lock(&sCachesLock); if (InitCheck() == B_OK) {
sCaches.Remove(this); mutex_lock(&sCachesLock);
mutex_unlock(&sCachesLock); sCaches.Remove(this);
mutex_unlock(&sCachesLock);
unregister_low_resource_handler(&block_cache::LowMemoryHandler, this); unregister_low_resource_handler(&block_cache::LowMemoryHandler, this);
mutex_destroy(&lock); mutex_destroy(&lock);
}
condition_variable.Unpublish(); condition_variable.Unpublish();