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:
+7
@@ -350,6 +350,13 @@ block_cache::LowMemoryHandler(void *data, int32 level)
|
|||||||
block_cache *cache = (block_cache *)data;
|
block_cache *cache = (block_cache *)data;
|
||||||
BenaphoreLocker locker(&cache->lock);
|
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));
|
TRACE(("block_cache: low memory handler called with level %ld\n", level));
|
||||||
|
|
||||||
// free some blocks according to the low memory state
|
// free some blocks according to the low memory state
|
||||||
|
|||||||
Reference in New Issue
Block a user