wim/WimClient/src/WimCert.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".
   328                 User::RequestComplete( iClientStatus, KErrNotFound );
   328                 User::RequestComplete( iClientStatus, KErrNotFound );
   329                 }
   329                 }
   330             else
   330             else
   331                 {
   331                 {
   332                 TCertificateAddressList  certRefLst = 
   332                 TCertificateAddressList  certRefLst = 
   333                      new( ELeave ) TCertificateAddress[iCertCount]; 
   333                      new( ELeave ) TCertificateAddress[ iCertCount ];
   334 
   334                 CleanupStack::PushL( TCleanupItem( CleanupRefLst, certRefLst ) );
   335                 CleanupStack::PushL( TCleanupItem( CleanupRefLst,
       
   336                                                    certRefLst ) );
       
   337 
   335 
   338                 TWimCertInfo* certInfoArr = new( ELeave ) 
   336                 TWimCertInfo* certInfoArr = new( ELeave ) 
   339                                         TWimCertInfo[iCertCount];
   337                                         TWimCertInfo[iCertCount];
   340 
   338 
   341                 CleanupStack::PushL( TCleanupItem( Cleanup, certInfoArr ) );
   339                 CleanupStack::PushL( TCleanupItem( Cleanup, certInfoArr ) );
   679     aObject = NULL;
   677     aObject = NULL;
   680     }
   678     }
   681 
   679 
   682 // -----------------------------------------------------------------------------
   680 // -----------------------------------------------------------------------------
   683 // CWimCert::CleanupRefLst()
   681 // CWimCert::CleanupRefLst()
   684 // Handles cleanup for an object which is not derived from CBase
   682 // Handles cleanup of an TCertificateAddressList array
   685 // -----------------------------------------------------------------------------
   683 // -----------------------------------------------------------------------------
   686 //
   684 //
   687 void CWimCert::CleanupRefLst( TAny* aObject )
   685 void CWimCert::CleanupRefLst( TAny* aObject )
   688     {
   686     {
   689     _WIMTRACE ( _L( "CWimCert::CleanupRefLst()" ) );
   687     _WIMTRACE ( _L( "CWimCert::CleanupRefLst()" ) );
   690     delete[] aObject;  
   688     TCertificateAddressList* certRefLst = static_cast< TCertificateAddressList* >( aObject );
       
   689     delete[] certRefLst;
   691     aObject = NULL;
   690     aObject = NULL;
   692     }
   691     }
   693 
   692 
   694 // -----------------------------------------------------------------------------
   693 // -----------------------------------------------------------------------------
   695 // CWimCert::DeallocRArrays()
   694 // CWimCert::DeallocRArrays()