uiacceltk/hitchcock/goommonitor/src/goommemorymonitorsession.cpp
changeset 38 69409653e863
parent 14 83d2d132aa58
child 53 5ba07f7750a9
--- a/uiacceltk/hitchcock/goommonitor/src/goommemorymonitorsession.cpp	Wed Jun 09 11:48:49 2010 +0300
+++ b/uiacceltk/hitchcock/goommonitor/src/goommemorymonitorsession.cpp	Tue Jun 22 12:40:35 2010 +0300
@@ -35,12 +35,7 @@
 CMemoryMonitorSession::~CMemoryMonitorSession()
     {
     FUNC_LOG;
-	/* TODO - need to add the right condition
-    if (iUseAbsoluteTargets)
-        { // se3ssion terminated while on critical allocation, release lock
-        Server().Monitor().SessionInCriticalAllocation(0);
-        }
-	*/
+    Server().Monitor().SessionInCriticalAllocation(0,0);
     CloseAppsFinished(0, EFalse);
     }
 
@@ -91,7 +86,12 @@
                 Server().Monitor().SessionInCriticalAllocation(1, clientId);
                 
                 TRAPD(err, Monitor().RequestFreeMemoryL(aMessage.Int0()));
-                if (err)
+                if(err == KErrCompletion) 
+                    {
+                    TRACES("There is already enough memory - nothing to do");
+                    Server().Monitor().SessionInCriticalAllocation(0, clientId);
+                    }
+                else if (err != KErrNone )
                     {
                     // completes the message if that was left to pending
                     TRACES1("Error in RequestFreeMemory %d", err);