kernel/eka/memmodel/epoc/flexible/mmu/maddressspace.cpp
changeset 109 b3a1d9898418
parent 0 a41df078684a
child 257 3e88ff8f41d5
--- a/kernel/eka/memmodel/epoc/flexible/mmu/maddressspace.cpp	Mon May 03 13:47:38 2010 +0300
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/maddressspace.cpp	Fri May 14 17:13:29 2010 +0300
@@ -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();
 	}