From e506fde883c37e843879cbef193f3caa10703bd3 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Tue, 13 Apr 2010 21:18:52 +0000 Subject: [PATCH] wait_if_address_range_is_wired() was leaking a cache reference. Fixes #5710. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36237 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/vm/vm.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/system/kernel/vm/vm.cpp b/src/system/kernel/vm/vm.cpp index 5b33ac69b9..0f8f9a5523 100644 --- a/src/system/kernel/vm/vm.cpp +++ b/src/system/kernel/vm/vm.cpp @@ -955,12 +955,10 @@ wait_if_address_range_is_wired(VMAddressSpace* addressSpace, addr_t base, if (base >= area->Base() + area->Size() - 1) continue; - VMCache* cache = vm_area_get_locked_cache(area); + AreaCacheLocker cacheLocker(vm_area_get_locked_cache(area)); - if (wait_if_area_range_is_wired(area, base, size, locker, cache)) + if (wait_if_area_range_is_wired(area, base, size, locker, &cacheLocker)) return true; - - cache->Unlock(); } return false;