sysresmonitoring/oommonitor/src/oomcloseapp.cpp
changeset 60 d55467af0fda
parent 35 13fd6fd25fe7
--- a/sysresmonitoring/oommonitor/src/oomcloseapp.cpp	Fri Aug 06 10:45:02 2010 +0300
+++ b/sysresmonitoring/oommonitor/src/oomcloseapp.cpp	Mon Aug 16 13:23:30 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();
         }
     }