# HG changeset patch # User hgs # Date 1286188340 -10800 # Node ID eab116a48b80ccf2e06a3aa64579ba02e5e3949b # Parent 6ac064bb53ebabc3046977c355d85fcbfd5dbc12 201039_02 diff -r 6ac064bb53eb -r eab116a48b80 package_definition.xml --- a/package_definition.xml Tue Sep 21 11:21:11 2010 +0300 +++ b/package_definition.xml Mon Oct 04 13:32:20 2010 +0300 @@ -1,8 +1,11 @@ - + + + + @@ -40,15 +43,24 @@ + + + + + + + + + @@ -64,6 +76,9 @@ + + + @@ -71,6 +86,9 @@ + + + @@ -79,6 +97,9 @@ + + + @@ -89,6 +110,9 @@ + + + @@ -133,6 +157,9 @@ + + + @@ -179,6 +206,9 @@ --> + + + @@ -196,6 +226,9 @@ + + + diff -r 6ac064bb53eb -r eab116a48b80 upnpavcontroller/upnpavcontrollerhelper/src/upnpdownloaditemresolver.cpp --- a/upnpavcontroller/upnpavcontrollerhelper/src/upnpdownloaditemresolver.cpp Tue Sep 21 11:21:11 2010 +0300 +++ b/upnpavcontroller/upnpavcontrollerhelper/src/upnpdownloaditemresolver.cpp Mon Oct 04 13:32:20 2010 +0300 @@ -572,6 +572,7 @@ // parse protocol info CUpnpDlnaProtocolInfo* pInfo = NULL; pInfo = CUpnpDlnaProtocolInfo::NewL( attr->Value() ); + CleanupStack::PushL( pInfo ); //if DLNA compliant item if ( pInfo->PnParameter() != KNullDesC8() ) @@ -590,6 +591,7 @@ } } + CleanupStack::PopAndDestroy( pInfo ); } diff -r 6ac064bb53eb -r eab116a48b80 upnpavcontroller/upnpavcontrollerserver/src/upnpavcontrollerimpl.cpp --- a/upnpavcontroller/upnpavcontrollerserver/src/upnpavcontrollerimpl.cpp Tue Sep 21 11:21:11 2010 +0300 +++ b/upnpavcontroller/upnpavcontrollerserver/src/upnpavcontrollerimpl.cpp Mon Oct 04 13:32:20 2010 +0300 @@ -440,8 +440,10 @@ { CUpnpAVDevice* tempDev = CUpnpAVDevice::NewL( *devList[i] ); + CleanupStack::PushL( tempDev ); // Ownership of tempDev transferred tempList->AppendDeviceL( *tempDev ); + CleanupStack::Pop( tempDev ); } } } diff -r 6ac064bb53eb -r eab116a48b80 upnpavcontroller/upnpavcontrollerserver/src/upnpavcontrollerserver.cpp --- a/upnpavcontroller/upnpavcontrollerserver/src/upnpavcontrollerserver.cpp Tue Sep 21 11:21:11 2010 +0300 +++ b/upnpavcontroller/upnpavcontrollerserver/src/upnpavcontrollerserver.cpp Mon Oct 04 13:32:20 2010 +0300 @@ -739,7 +739,9 @@ if( iStartMessages.Count() > 0 ) { RMessage2* message = new (ELeave) RMessage2( aMessage ); + CleanupStack::PushL( message); iStartMessages.AppendL( message ); + CleanupStack::Pop( message ); } else { diff -r 6ac064bb53eb -r eab116a48b80 upnpavcontroller/upnpavcontrollerserver/src/upnpuploadsession.cpp --- a/upnpavcontroller/upnpavcontrollerserver/src/upnpuploadsession.cpp Tue Sep 21 11:21:11 2010 +0300 +++ b/upnpavcontroller/upnpavcontrollerserver/src/upnpuploadsession.cpp Mon Oct 04 13:32:20 2010 +0300 @@ -378,9 +378,12 @@ CUPnPResourceHelper* helper = CUPnPResourceHelper::NewL(); CleanupStack::Pop( tmpUpnpItem ); + CleanupStack::PushL( helper ); helper->SetItem( tmpUpnpItem ); // Transfer ownership iResources.AppendL( helper ); + CleanupStack::Pop( helper ); + iUploader->MoveToTransferQueueL( (TAny*)transferItem.iKey ); CleanupStack::PopAndDestroy( tmpTransferItem ); diff -r 6ac064bb53eb -r eab116a48b80 upnpavcontroller/upnpxmlparser/src/upnpxmlparserlite.cpp --- a/upnpavcontroller/upnpxmlparser/src/upnpxmlparserlite.cpp Tue Sep 21 11:21:11 2010 +0300 +++ b/upnpavcontroller/upnpxmlparser/src/upnpxmlparserlite.cpp Mon Oct 04 13:32:20 2010 +0300 @@ -289,15 +289,19 @@ CleanupStack::PushL( tempBuf ); HBufC* buf = HBufC::NewL( iFormatString->Length() + tempBuf->Length() ); + CleanupStack::PushL( buf ); buf->Des().Format( *iFormatString, tempBuf ); + obj->SetTitleL( buf ); + CleanupStack::Pop( buf ); CleanupStack::PopAndDestroy( tempBuf ); - obj->SetTitleL( buf ); } else { HBufC* buf = HBufC::NewL( iTitleBuf->Length() ); + CleanupStack::PushL( buf ); buf->Des().Copy( *iTitleBuf ); obj->SetTitleL( buf ); + CleanupStack::Pop( buf ); } delete iTitleBuf; iTitleBuf = NULL; } diff -r 6ac064bb53eb -r eab116a48b80 upnpavcontrolpoint/avcpengine/inc/upnpbrowsecommand.h --- a/upnpavcontrolpoint/avcpengine/inc/upnpbrowsecommand.h Tue Sep 21 11:21:11 2010 +0300 +++ b/upnpavcontrolpoint/avcpengine/inc/upnpbrowsecommand.h Mon Oct 04 13:32:20 2010 +0300 @@ -53,7 +53,12 @@ /** * Destructor. */ - virtual ~CUpnpBrowseCommand(); + virtual ~CUpnpBrowseCommand(); + + /** + * Cleanup Mechanism + */ + static void CleanupArray(TAny* aDirs); public: // Method from CUpnpCommand /** diff -r 6ac064bb53eb -r eab116a48b80 upnpavcontrolpoint/avcpengine/src/upnpbrowsecommand.cpp --- a/upnpavcontrolpoint/avcpengine/src/upnpbrowsecommand.cpp Tue Sep 21 11:21:11 2010 +0300 +++ b/upnpavcontrolpoint/avcpengine/src/upnpbrowsecommand.cpp Mon Oct 04 13:32:20 2010 +0300 @@ -148,15 +148,26 @@ //ASSERT(aMessage.Function() == EDownloadDirList); TInt size = iResult.Count(); - TFileInfo* dirs = new TFileInfo[size]; + TFileInfo* dirs = new TFileInfo[size]; + CleanupStack::PushL(TCleanupItem(CleanupArray, dirs)); for (TInt i = 0; i < size; i++) { dirs[i] = iResult[i]; } TPtr8 result(reinterpret_cast(dirs), sizeof(TFileInfo)*size, sizeof(TFileInfo)*size); aMessage.WriteL(1, result); - delete[] dirs; + CleanupStack::PopAndDestroy(dirs); } + +// ----------------------------------------------------------------------------- +// CUpnpBrowseCommand::CleanupArray +// ----------------------------------------------------------------------------- +// +void CUpnpBrowseCommand::CleanupArray(TAny* aDirs) + { + TFileInfo* dirs = (TFileInfo*) aDirs ; + delete[] dirs; + } // ----------------------------------------------------------------------------- diff -r 6ac064bb53eb -r eab116a48b80 upnpavcontrolpoint/avcpengineclient/inc/upnpavcpenginerfsclient.h --- a/upnpavcontrolpoint/avcpengineclient/inc/upnpavcpenginerfsclient.h Tue Sep 21 11:21:11 2010 +0300 +++ b/upnpavcontrolpoint/avcpengineclient/inc/upnpavcpenginerfsclient.h Mon Oct 04 13:32:20 2010 +0300 @@ -138,6 +138,12 @@ * @return converted object of CDirEnt */ CRsfwDirEnt* RUpnpAVCPEngineRFSClient::GetFileInformationL(TFileInfo& aFileInfo); + + public: + /* + * Custom cleanup mechanism + */ + static void CleanupArray(TAny* aDirs); }; #endif // C_RUPNPAVCPENGINERFSCLIENT_H diff -r 6ac064bb53eb -r eab116a48b80 upnpavcontrolpoint/avcpengineclient/src/upnpavcpenginerfsclient.cpp --- a/upnpavcontrolpoint/avcpengineclient/src/upnpavcpenginerfsclient.cpp Tue Sep 21 11:21:11 2010 +0300 +++ b/upnpavcontrolpoint/avcpengineclient/src/upnpavcpenginerfsclient.cpp Mon Oct 04 13:32:20 2010 +0300 @@ -39,7 +39,16 @@ :RUpnpAVCPEngineClient() { } - + +// ----------------------------------------------------------------------------- +// Cleanup mechanism +// ----------------------------------------------------------------------------- +// +void RUpnpAVCPEngineRFSClient::CleanupArray(TAny* aDirs) + { + TFileInfo* dirs = (TFileInfo*) aDirs ; + delete[] dirs; + } // ----------------------------------------------------------------------------- // RUpnpAVCPEngineRFSClient::GetDirectoryL @@ -64,6 +73,7 @@ { TFileInfo* dirs = new TFileInfo[size]; // put array on cleanup stack + CleanupStack::PushL(TCleanupItem(CleanupArray, dirs)); TPtr8 result(reinterpret_cast(dirs), sizeof(TFileInfo)*size, sizeof(TFileInfo)*size); err = SendReceive(EDownloadDirList,TIpcArgs(id, &result)); @@ -72,7 +82,7 @@ CRsfwDirEnt* entry = GetFileInformationL(dirs[i]); aDirList.AppendL(entry); } - delete[] dirs; + CleanupStack::PopAndDestroy(dirs); } return err; } diff -r 6ac064bb53eb -r eab116a48b80 upnpframework/upnpcommonui/src/upnpbrowsedialog.cpp --- a/upnpframework/upnpcommonui/src/upnpbrowsedialog.cpp Tue Sep 21 11:21:11 2010 +0300 +++ b/upnpframework/upnpcommonui/src/upnpbrowsedialog.cpp Mon Oct 04 13:32:20 2010 +0300 @@ -2456,11 +2456,13 @@ if ( !alreadyInArray ) { CUpnpItem* itemForSelectionArray = CUpnpItem::NewL(); + CleanupStack::PushL( itemForSelectionArray ); itemForSelectionArray->CopyL( *iResultArray[ indexes->At( selectionCount ) ] ); iSelectedItemsArray.AppendL( itemForSelectionArray ); + CleanupStack::Pop( itemForSelectionArray ); } } } diff -r 6ac064bb53eb -r eab116a48b80 upnpharvester/common/cmsqlwrapper/src/cmsqldbclause.cpp --- a/upnpharvester/common/cmsqlwrapper/src/cmsqldbclause.cpp Tue Sep 21 11:21:11 2010 +0300 +++ b/upnpharvester/common/cmsqlwrapper/src/cmsqldbclause.cpp Mon Oct 04 13:32:20 2010 +0300 @@ -275,6 +275,7 @@ ( dataField.Length() * multiplier ) ); HBufC8* temp = HBufC8::NewMaxL( iFreeText->Length() + ( dataField.Length() * multiplier ) ); + CleanupStack::PushL( temp ); // Format dataField into clause if( multiplier == 1 ) { @@ -293,7 +294,7 @@ iClause = iClause->ReAllocL( iClause->Length() + temp->Length() ); iClause->Des().Append( *temp ); - delete temp; + CleanupStack::PopAndDestroy( temp ); } else { diff -r 6ac064bb53eb -r eab116a48b80 upnpmediaserver/avobjects/src/upnpdlnaprotocolinfo.cpp --- a/upnpmediaserver/avobjects/src/upnpdlnaprotocolinfo.cpp Tue Sep 21 11:21:11 2010 +0300 +++ b/upnpmediaserver/avobjects/src/upnpdlnaprotocolinfo.cpp Mon Oct 04 13:32:20 2010 +0300 @@ -272,8 +272,9 @@ User::Leave( KErrArgument ); TLex8* ptr = new TLex8(value); + CleanupStack::PushL(ptr); User::LeaveIfError(ptr->Val(iDlnaFlags[i], EHex)); - delete ptr; + CleanupStack::PopAndDestroy(ptr); } SkipAndMark(aLexer,1); } diff -r 6ac064bb53eb -r eab116a48b80 upnpmediaserver/avobjects/src/upnpitem.cpp --- a/upnpmediaserver/avobjects/src/upnpitem.cpp Tue Sep 21 11:21:11 2010 +0300 +++ b/upnpmediaserver/avobjects/src/upnpitem.cpp Mon Oct 04 13:32:20 2010 +0300 @@ -58,7 +58,9 @@ EXPORT_C CUpnpItem* CUpnpItem::NewL( ) { CUpnpItem* self = new( ELeave ) CUpnpItem; + CleanupStack::PushL( self ); self->ConstructL(); + CleanupStack::Pop( self ); return self; } diff -r 6ac064bb53eb -r eab116a48b80 upnpsettings/multiselectionui/src/upnpappmultiselectionpopup.cpp --- a/upnpsettings/multiselectionui/src/upnpappmultiselectionpopup.cpp Tue Sep 21 11:21:11 2010 +0300 +++ b/upnpsettings/multiselectionui/src/upnpappmultiselectionpopup.cpp Mon Oct 04 13:32:20 2010 +0300 @@ -64,9 +64,12 @@ CUPnPAppMultiselectionPopup* self = new(ELeave) CUPnPAppMultiselectionPopup( NULL, aHeading ); + CleanupStack::PushL( self); self->ConstructL( aMediaType, aFileSharingEngine,aSelectionIndexArray ); - + + CleanupStack::Pop( self); + __LOG("CUPnPAppMultiselectionPopup::NewL end"); return self; } diff -r 6ac064bb53eb -r eab116a48b80 upnpsettings/upnpgsplugin/src/upnpappsettingitemhomeiap.cpp --- a/upnpsettings/upnpgsplugin/src/upnpappsettingitemhomeiap.cpp Tue Sep 21 11:21:11 2010 +0300 +++ b/upnpsettings/upnpgsplugin/src/upnpappsettingitemhomeiap.cpp Mon Oct 04 13:32:20 2010 +0300 @@ -133,10 +133,12 @@ if ( iSharingState || status == UPnPAVControllerFactory::EStatusActive ) { CAknInformationNote* note = new (ELeave) CAknInformationNote; + CleanupStack::PushL(note); HBufC* noteText = iCoeEnv->AllocReadResourceLC( R_QTN_IUPNP_IAP_TURN_SHARING_OFF); note->ExecuteLD(*noteText); CleanupStack::PopAndDestroy(noteText); + CleanupStack::Pop(note); return; } diff -r 6ac064bb53eb -r eab116a48b80 upnpsharing/upnpdlnaprofiler/src/upnpaudiosolverbase.cpp --- a/upnpsharing/upnpdlnaprofiler/src/upnpaudiosolverbase.cpp Tue Sep 21 11:21:11 2010 +0300 +++ b/upnpsharing/upnpdlnaprofiler/src/upnpaudiosolverbase.cpp Mon Oct 04 13:32:20 2010 +0300 @@ -323,8 +323,9 @@ // delete temporary file RFs fs; User::LeaveIfError( fs.Connect() ); + CleanupClosePushL( fs ); User::LeaveIfError( fs.Delete( KTargetAudioFile() ) ); - fs.Close(); + CleanupStack::PopAndDestroy( &fs ); return retval; } diff -r 6ac064bb53eb -r eab116a48b80 upnpsharing/upnpdlnaprofiler/src/upnpdlnaprofiler.cpp --- a/upnpsharing/upnpdlnaprofiler/src/upnpdlnaprofiler.cpp Tue Sep 21 11:21:11 2010 +0300 +++ b/upnpsharing/upnpdlnaprofiler/src/upnpdlnaprofiler.cpp Mon Oct 04 13:32:20 2010 +0300 @@ -62,13 +62,19 @@ { __LOG( "[UPnPDlnaProfiler] ConstructL" ); CUpnpAudioSolverBase* baseAudioSolver = CUpnpAudioSolverBase::NewL(); + CleanupStack::PushL( baseAudioSolver ); iAudioSolvers.AppendL( baseAudioSolver ); + CleanupStack::Pop( baseAudioSolver ); CUpnpAvSolverBase* baseAvSolver = CUpnpAvSolverBase::NewL(); + CleanupStack::PushL( baseAvSolver ); iAvSolvers.AppendL( baseAvSolver ); + CleanupStack::Pop( baseAvSolver ); CUpnpImageSolverBase* baseImageSolver = CUpnpImageSolverBase::NewL(); + CleanupStack::PushL( baseImageSolver ); iImageSolvers.AppendL( baseImageSolver ); + CleanupStack::Pop( baseImageSolver ); }