webengine/osswebengine/MemoryManager/Src/MemoryPool.cpp
branchRCL_3
changeset 92 e1bea15f9a39
parent 91 30342f40acbf
child 93 79859ed3eea9
--- a/webengine/osswebengine/MemoryManager/Src/MemoryPool.cpp	Thu Jul 15 19:53:20 2010 +0300
+++ b/webengine/osswebengine/MemoryManager/Src/MemoryPool.cpp	Thu Aug 19 10:58:56 2010 +0300
@@ -82,6 +82,10 @@
     TInt idx = iStoppers.Find( aStopper );
     if( idx != KErrNotFound )
         iStoppers.Remove( idx );
+    
+    if(iStoppers.Count() == 0 && iStopScheduler->IsActive()) // cancel stop if nobody is interested
+        iStopScheduler->Cancel();
+        
     }
 
 //-----------------------------------------------------------------------------
@@ -490,7 +494,7 @@
     TAny *p = iAlloc->Alloc( aSize );
     if(iAlloc->isLowSystemMemory && p) // use this a pre OOM indicator
         {
-        iStopScheduler->Start( CStopScheduler::ECheckMemory, 0 );                
+        if(iStopScheduler) iStopScheduler->Start( CStopScheduler::ECheckMemory, 0 );                
         iAlloc->isLowSystemMemory = 0; // reset so that we don't check before next request for RAM
         }
         
@@ -512,7 +516,7 @@
     TAny* p = iAlloc->ReAlloc( aPtr, aSize );
     if(iAlloc->isLowSystemMemory && p) // use this a pre OOM indicator
         {
-        iStopScheduler->Start( CStopScheduler::ECheckMemory, 0 );                
+        if(iStopScheduler) iStopScheduler->Start( CStopScheduler::ECheckMemory, 0 );                
         iAlloc->isLowSystemMemory = 0; // reset so that we don't check before next request for RAM
         }