diff -r b42b9ce90ea9 -r 661475905584 kernel/eka/memmodel/epoc/flexible/mmu/maddressspace.cpp --- a/kernel/eka/memmodel/epoc/flexible/mmu/maddressspace.cpp Fri Apr 23 22:02:01 2010 +0100 +++ b/kernel/eka/memmodel/epoc/flexible/mmu/maddressspace.cpp Fri Apr 23 22:08:41 2010 +0100 @@ -245,14 +245,14 @@ { TRACE(("DAddressSpace::FreeVirtualMemory(0x%08x,0x%08x) osAsid=%d",aAddr, aSize, iOsAsid)); Lock(); - if(iOsAsid==(TInt)KKernelOsAsid && UserGlobalVirtualAllocator.InRange(aAddr,aSize)) + TBool global = iOsAsid==(TInt)KKernelOsAsid && UserGlobalVirtualAllocator.InRange(aAddr,aSize); + if(global) UserGlobalVirtualAllocator.Free(aAddr,aSize); else - { iVirtualAllocator.Free(aAddr,aSize); + Unlock(); + if (!global) AsyncClose(); - } - Unlock(); }