kernel/eka/memmodel/epoc/flexible/mmu/maddressspace.cpp
changeset 121 661475905584
parent 0 a41df078684a
child 257 3e88ff8f41d5
--- 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();
 	}