diff -r bbf46f59e123 -r 25ffed67c7ef windowing/windowserver/nga/SERVER/openwfc/WSTOP.CPP --- a/windowing/windowserver/nga/SERVER/openwfc/WSTOP.CPP Tue Aug 31 16:31:06 2010 +0300 +++ b/windowing/windowserver/nga/SERVER/openwfc/WSTOP.CPP Wed Sep 01 12:39:21 2010 +0100 @@ -32,7 +32,7 @@ #include "pointer.h" #include "WSGRAPHICDRAWERFACTORY.H" #include "redrawmsgwindow.h" -#include +#include #include "WsMemMgr.h" #include "backedupwindow.h" #include "wsfont.h" @@ -46,7 +46,6 @@ #include "registeredsurfacemap.h" #include "windowelementset.h" #include "wspluginmanager.h" -#include "renderorientationtracker.h" // IDs of p&s properties that optionally contain callbacks that may be used // to release singletons owned by libraries at shutdown in order to make @@ -210,7 +209,6 @@ TInt CWsTop::iCheckHeapResult=KErrNotReady; TBool CWsTop::iDoHeapCheckAndRestart=EFalse; #define RFbsSession_SendCommand_ShutDownMessage 1 // A FBS message that is not published yet and probably never will be. -CWsRenderOrienationTracker* CWsTop::iRenderOrientationTracker=NULL; static void DefineSingletonKey(const TUid& aSingletonKey) /** @@ -283,8 +281,6 @@ void CWsTop::DeleteStaticsL() { iShuttingDown=ETrue; - delete iRenderOrientationTracker; - CClick::DeleteStatics(); TWsPointer::Stop(); CWsClient::DeleteStatics(); @@ -557,8 +553,6 @@ StartShell(); } UserSvr::WsRegisterSwitchOnScreenHandling(ETrue); - - iRenderOrientationTracker = CWsRenderOrienationTracker::NewL(); } @@ -903,6 +897,31 @@ iHeapCheckMode=aCheckHeapOnDisconnectMode; } +static void ReportAllCurrentLevelLeaks() + { + class RHeapWalk: public RHeap + { + public: + static void WalkCheckCell(TAny* aPtr, TCellType aType, TAny* aCell, TInt aLen) + { + RHeapWalk* heap=(RHeapWalk*)aPtr; + (void)aCell; + switch(aType) + { + case EGoodAllocatedCell: + if ( ((SDebugCell*)aCell)->nestingLevel == heap->iNestingLevel ) + { + RDebug::Printf("Leaked heap cell: level %i, serial %i @ %08x : len=%d", + heap->iNestingLevel, ((SDebugCell*)aCell)->allocCount, aCell, aLen); + } + break; + } + } + }; + + User::Heap().DebugFunction(RHeap::EWalk, (TAny*)RHeapWalk::WalkCheckCell, &User::Heap()); + } + TBool CWsTop::NeedsHeapCheckAndRestart(TInt aStartHeapCount) { if (!iDoHeapCheckAndRestart) @@ -913,6 +932,7 @@ { const TUint32 orphanedCell = User::Heap().__DbgMarkEnd(aStartHeapCount); RDebug::Printf("Memory leak detected in wserv. First orphaned cell: 0x%8x", orphanedCell); + ReportAllCurrentLevelLeaks(); } return(ETrue); } @@ -964,18 +984,6 @@ return EFalse; } -/** -Checks to see if the render orientation has changed, and publishes any new orientaion -via publish and subscribe - -@see KRenderOrientationCategory -@see KRenderOrientationKey -*/ -void CWsTop::CheckRenderOrientation() - { - iRenderOrientationTracker->CheckRenderOrientation(); - } - typedef TInt (*ShellEntryPoint)(TAny *); #if defined(__WINS__)