The block_cache::LowMemoryHandler() must check if it could acquire the cache's lock;
it might have been deleted in the mean time. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15565 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
182f88dda1
commit
4c0f46e2a3
7
src/system/kernel/cache/block_cache.cpp
vendored
7
src/system/kernel/cache/block_cache.cpp
vendored
@ -350,6 +350,13 @@ block_cache::LowMemoryHandler(void *data, int32 level)
|
||||
block_cache *cache = (block_cache *)data;
|
||||
BenaphoreLocker locker(&cache->lock);
|
||||
|
||||
if (!locker.IsLocked()) {
|
||||
// If our block_cache were deleted, it could be that we had
|
||||
// been called before that deletion went through, therefore,
|
||||
// acquiring its lock might fail.
|
||||
return;
|
||||
}
|
||||
|
||||
TRACE(("block_cache: low memory handler called with level %ld\n", level));
|
||||
|
||||
// free some blocks according to the low memory state
|
||||
|
Loading…
Reference in New Issue
Block a user