sysresmonitoring/oommonitor/src/oomcloseapp.cpp
changeset 65 8a530a83576a
parent 35 13fd6fd25fe7
--- a/sysresmonitoring/oommonitor/src/oomcloseapp.cpp	Wed Aug 18 09:58:19 2010 +0300
+++ b/sysresmonitoring/oommonitor/src/oomcloseapp.cpp	Thu Sep 02 20:36:53 2010 +0300
@@ -59,15 +59,20 @@
     
     RThread thread;
     TInt err=thread.Open(iCurrentTask.ThreadId());
-    if (!err)
+    if (err == KErrNone)
         {
         RProcess process;
-        thread.Process(process);
-        TBool isDataPaged = process.DefaultDataPaged();
-        if((aIsDataPaged && isDataPaged) || (!aIsDataPaged && !isDataPaged ))
+        err = thread.Process(process);
+        if(err == KErrNone)
             {
-            iCurrentTask.EndTask();
+            TBool isDataPaged = process.DefaultDataPaged();
+            if((aIsDataPaged && isDataPaged) || (!aIsDataPaged && !isDataPaged ))
+                {
+                iCurrentTask.EndTask();
+                }                    
+            process.Close();
             }
+        thread.Close();
         }
     }