# HG changeset patch # User hgs # Date 1276073329 -10800 # Node ID 27a3ad0677c1aa7e5019a2323d56516ea7e1f3e5 # Parent 1b690941875700dc2db6c06527fd8d89172abef0 201023_01 diff -r 1b6909418757 -r 27a3ad0677c1 uiacceltk/hitchcock/goommonitor/inc/goomwindowgrouplist.h --- a/uiacceltk/hitchcock/goommonitor/inc/goomwindowgrouplist.h Tue Jun 08 13:16:48 2010 +0300 +++ b/uiacceltk/hitchcock/goommonitor/inc/goomwindowgrouplist.h Wed Jun 09 11:48:49 2010 +0300 @@ -91,7 +91,7 @@ } } - + TInt FindParentIdL(TInt aWgId); private: @@ -99,7 +99,6 @@ void RemovePropertiesForClosedWindowsL(); - TInt FindParentIdL(TInt aWgId); private: diff -r 1b6909418757 -r 27a3ad0677c1 uiacceltk/hitchcock/goommonitor/src/goomactionlist.cpp --- a/uiacceltk/hitchcock/goommonitor/src/goomactionlist.cpp Tue Jun 08 13:16:48 2010 +0300 +++ b/uiacceltk/hitchcock/goommonitor/src/goomactionlist.cpp Wed Jun 09 11:48:49 2010 +0300 @@ -363,12 +363,45 @@ TInt32 fgApp = wgName->AppUid().iUid; TInt32 appId = iMonitor.GetWindowGroupList()->AppIdfromWgId(ref.WgId(), ETrue); - CleanupStack::PopAndDestroy(); + if(appId == fgApp) { TRACES1("Foreground App wgid %x, spared by GOOM", appId); iCurrentActionIndex++; + CleanupStack::PopAndDestroy(); + continue; + } + + //check if this is not parent of foreground app + TBool spared = EFalse; + TRACES1("CGOomActionList::FreeMemory - Going to kill Appid %x ",appId); + TInt prevWgId = 0; + while(prevWgId != KErrNotFound) + { + wgName->FindByAppUid(wgName->AppUid(), iWs, prevWgId); + + if(prevWgId == KErrNotFound) + break; + + TInt parentId = 0; + TRAPD(err, parentId = iMonitor.GetWindowGroupList()->FindParentIdL(prevWgId)); + TRACES2("CGOomActionList::FreeMemory - Foreground App wgid %d, parent wgid %d",prevWgId, parentId); + if( err == KErrNone && parentId != 0) + { + TInt32 parentAppId = iMonitor.GetWindowGroupList()->AppIdfromWgId(parentId, ETrue); + if(parentAppId == appId) + { + TRACES3("Parent App %x (wgId %d), of Foreground App %x, spared by GOOM", parentAppId, parentId, fgApp); + spared = ETrue; + break; + } + } + } + CleanupStack::PopAndDestroy(); + if(spared) + { + iCurrentActionIndex++; continue; } }