uiacceltk/hitchcock/goommonitor/src/goommemorymonitorsession.cpp
changeset 43 95d73125a086
parent 14 83d2d132aa58
child 53 5ba07f7750a9
equal deleted inserted replaced
42:b80cfcbd075a 43:95d73125a086
    33     }
    33     }
    34 
    34 
    35 CMemoryMonitorSession::~CMemoryMonitorSession()
    35 CMemoryMonitorSession::~CMemoryMonitorSession()
    36     {
    36     {
    37     FUNC_LOG;
    37     FUNC_LOG;
    38 	/* TODO - need to add the right condition
    38     Server().Monitor().SessionInCriticalAllocation(0,0);
    39     if (iUseAbsoluteTargets)
       
    40         { // se3ssion terminated while on critical allocation, release lock
       
    41         Server().Monitor().SessionInCriticalAllocation(0);
       
    42         }
       
    43 	*/
       
    44     CloseAppsFinished(0, EFalse);
    39     CloseAppsFinished(0, EFalse);
    45     }
    40     }
    46 
    41 
    47 CMemoryMonitorServer& CMemoryMonitorSession::Server()
    42 CMemoryMonitorServer& CMemoryMonitorSession::Server()
    48     {
    43     {
    89                 iRequestFreeRam = aMessage;
    84                 iRequestFreeRam = aMessage;
    90 
    85 
    91                 Server().Monitor().SessionInCriticalAllocation(1, clientId);
    86                 Server().Monitor().SessionInCriticalAllocation(1, clientId);
    92                 
    87                 
    93                 TRAPD(err, Monitor().RequestFreeMemoryL(aMessage.Int0()));
    88                 TRAPD(err, Monitor().RequestFreeMemoryL(aMessage.Int0()));
    94                 if (err)
    89                 if(err == KErrCompletion) 
       
    90                     {
       
    91                     TRACES("There is already enough memory - nothing to do");
       
    92                     Server().Monitor().SessionInCriticalAllocation(0, clientId);
       
    93                     }
       
    94                 else if (err != KErrNone )
    95                     {
    95                     {
    96                     // completes the message if that was left to pending
    96                     // completes the message if that was left to pending
    97                     TRACES1("Error in RequestFreeMemory %d", err);
    97                     TRACES1("Error in RequestFreeMemory %d", err);
    98                     CloseAppsFinished(0, EFalse);
    98                     CloseAppsFinished(0, EFalse);
    99                     }
    99                     }