wim/WimClient/src/WimSecModule.cpp
changeset 14 b75757c81051
parent 0 164170e6151a
equal deleted inserted replaced
1:d5423fbb4f29 14:b75757c81051
     1 /*
     1 /*
     2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
     2 * Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
   479     iPinCount = pinCount;
   479     iPinCount = pinCount;
   480     iPinInfoLst->Reset();
   480     iPinInfoLst->Reset();
   481     
   481     
   482     if ( pinCount )
   482     if ( pinCount )
   483         {
   483         {
   484         TPinAddress* pinLst = new( ELeave ) TPinAddress[pinCount];  
   484         TPinAddress* pinLst = new( ELeave ) TPinAddress[ pinCount ];
   485         CleanupStack::PushL( TCleanupItem( Cleanup, pinLst ) );
   485         CleanupStack::PushL( TCleanupItem( CleanupPinAddressList, pinLst ) );
   486         
   486         
   487         status = iClientSession->PINRefs( iReference, iPinLstAddr, pinLst,
   487         status = iClientSession->PINRefs( iReference, iPinLstAddr, pinLst,
   488                                         ( TText8 )pinCount );
   488                                         ( TText8 )pinCount );
   489         if ( status == KErrNone ) 
   489         if ( status == KErrNone ) 
   490             {
   490             {
   547     iPinCount = pinCount;
   547     iPinCount = pinCount;
   548     iPinInfoLst->Reset();
   548     iPinInfoLst->Reset();
   549     
   549     
   550     if ( pinCount )
   550     if ( pinCount )
   551         {
   551         {
   552         TPinAddress* pinLst = new( ELeave ) TPinAddress[pinCount];  
   552         TPinAddress* pinLst = new( ELeave ) TPinAddress[ pinCount ];
   553         
   553         CleanupStack::PushL( TCleanupItem( CleanupPinAddressList, pinLst ) );
   554         CleanupStack::PushL( TCleanupItem( Cleanup, pinLst ) );
       
   555         
   554         
   556         status = iClientSession->PINRefs( iReference, iPinLstAddr, pinLst,
   555         status = iClientSession->PINRefs( iReference, iPinLstAddr, pinLst,
   557                                         ( TText8 )pinCount );
   556                                         ( TText8 )pinCount );
   558         if ( status == KErrNone ) 
   557         if ( status == KErrNone ) 
   559             {
   558             {
   608     }
   607     }
   609 
   608 
   610 
   609 
   611 
   610 
   612 // -----------------------------------------------------------------------------
   611 // -----------------------------------------------------------------------------
   613 // CWimSecModule::Cleanup()
   612 // CWimSecModule::CleanupPinAddressList()
   614 // Handles cleanup for an object which is not derived from CBase
   613 // Handles cleanup of an TPinAddress array
   615 // -----------------------------------------------------------------------------
   614 // -----------------------------------------------------------------------------
   616 //
   615 //
   617 void CWimSecModule::Cleanup( TAny* aObject )
   616 void CWimSecModule::CleanupPinAddressList( TAny* aObject )
   618     {
   617     {
   619     _WIMTRACE ( _L( "CWimSecModule::Cleanup()" ) );
   618     _WIMTRACE ( _L( "CWimSecModule::Cleanup()" ) );
   620     delete aObject;
   619     TPinAddress* pinLst = static_cast< TPinAddress* >( aObject );
       
   620     delete[] pinLst;
   621     aObject = NULL;
   621     aObject = NULL;
   622     }
   622     }
   623 
   623 
   624 // -----------------------------------------------------------------------------
   624 // -----------------------------------------------------------------------------
   625 // CWimSecModule::SetClientSession()
   625 // CWimSecModule::SetClientSession()