From a1f34e7e89d783b993e02ceda31ea11c18614b3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 19 Aug 2008 11:30:14 +0000 Subject: [PATCH] * 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 --- src/system/kernel/cache/block_cache.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/system/kernel/cache/block_cache.cpp b/src/system/kernel/cache/block_cache.cpp index f0cab224f6..4917af388f 100644 --- a/src/system/kernel/cache/block_cache.cpp +++ b/src/system/kernel/cache/block_cache.cpp @@ -803,13 +803,15 @@ block_cache::~block_cache() { deleting = true; - mutex_lock(&sCachesLock); - sCaches.Remove(this); - mutex_unlock(&sCachesLock); + if (InitCheck() == B_OK) { + mutex_lock(&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();