sysresmonitoring/oommonitor/src/oomcloseapp.cpp
branchRCL_3
changeset 18 0818dd463d41
parent 1 0fdb7f6b0309
child 19 924385140d98
--- a/sysresmonitoring/oommonitor/src/oomcloseapp.cpp	Thu Jul 15 18:49:38 2010 +0300
+++ b/sysresmonitoring/oommonitor/src/oomcloseapp.cpp	Thu Aug 19 10:05:08 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -40,7 +40,7 @@
 
 // Close the application in order to free memory
 // Call the COomAction::MemoryFreed when it is done
-void COomCloseApp::FreeMemory(TInt)
+void COomCloseApp::FreeMemory(TInt, TBool aIsDataPaged)
     {
     FUNC_LOG;
 
@@ -56,7 +56,19 @@
     iAppCloseWatcher->Start(iCurrentTask);
     // Tell the app to close
     TRACES1("COomCloseApp::FreeMemory: Closing app with window group id %d",iWgId);
-    iCurrentTask.EndTask();
+    
+    RThread thread;
+    TInt err=thread.Open(iCurrentTask.ThreadId());
+    if (err == KErrNone)
+        {
+        RProcess process;
+        thread.Process(process);
+        TBool isDataPaged = process.DefaultDataPaged();
+        if((aIsDataPaged && isDataPaged) || (!aIsDataPaged && !isDataPaged ))
+            {
+            iCurrentTask.EndTask();
+            }
+        }
     }
 
 COomCloseApp::~COomCloseApp()