commondrm/drmutility/src/DrmUiHandlingImpl.cpp
branchRCL_3
changeset 88 c1bd57533c56
parent 72 1481bf457703
equal deleted inserted replaced
81:e9463401011b 88:c1bd57533c56
   387 //
   387 //
   388 DRM::CDrmUiHandlingImpl::~CDrmUiHandlingImpl()
   388 DRM::CDrmUiHandlingImpl::~CDrmUiHandlingImpl()
   389     {
   389     {
   390     DRM::CDrmUiHandlingData* data( PopFront() );
   390     DRM::CDrmUiHandlingData* data( PopFront() );
   391 
   391 
       
   392     // reset the current observer
       
   393     // it may already be deleted so don't do any calls to it.
       
   394     iObserver = NULL;
       
   395 
   392     // Empty the queue:
   396     // Empty the queue:
   393     while ( data )
   397     while ( data )
   394         {
   398         {
   395         // Complete the outstanding requestest with cancel
   399         // Complete the outstanding requestest with cancel
   396         data->iObserver->OperationCompleted( data->iOperationId, KErrCancel );
   400         data->iObserver->OperationCompleted( data->iOperationId, KErrCancel );
  1124         default:
  1128         default:
  1125 
  1129 
  1126             break;
  1130             break;
  1127         }
  1131         }
  1128 
  1132 
  1129     // Complete the client request
  1133     // if the observer exists and it has not been deleted, call complete
  1130     iObserver->OperationCompleted( iOperationId, KErrNone );
  1134     // for the operation and get ready for another round
  1131 
  1135     // this should prevent crashes in case the class is deleted before
       
  1136     // and operation finihes.
       
  1137     
       
  1138     if( iObserver && reinterpret_cast<TInt>(iObserver) != 0xDEDEDEDE )
       
  1139         {
       
  1140         // Complete the client request
       
  1141         iObserver->OperationCompleted( iOperationId, KErrNone );
       
  1142 
       
  1143         // Get ready for another round:
       
  1144         SetActive();
       
  1145 
       
  1146         // complete internal request:
       
  1147         User::RequestComplete( status, KErrNone );
       
  1148         }
       
  1149         
  1132     // destroy the object:
  1150     // destroy the object:
  1133     CleanupStack::PopAndDestroy( data );
  1151     CleanupStack::PopAndDestroy( data );
  1134 
  1152 
  1135     // Get ready for another round:
       
  1136     SetActive();
       
  1137 
       
  1138     // complete internal request:
       
  1139     User::RequestComplete( status, KErrNone );
       
  1140     }
  1153     }
  1141 
  1154 
  1142 // -----------------------------------------------------------------------------
  1155 // -----------------------------------------------------------------------------
  1143 // CDrmUiHandlingImpl::RunError()
  1156 // CDrmUiHandlingImpl::RunError()
  1144 // -----------------------------------------------------------------------------
  1157 // -----------------------------------------------------------------------------