mmappcomponents/collectionhelper/src/mpxcollectionuihelperimp.cpp
changeset 62 b276843a15ba
parent 32 edd273b3192a
equal deleted inserted replaced
58:c76ea6caa649 62:b276843a15ba
    82     iTotalChunkNumber = 0;
    82     iTotalChunkNumber = 0;
    83     iChunkNumber = 0;
    83     iChunkNumber = 0;
    84     iChunkSize = 0;
    84     iChunkSize = 0;
    85     iArrayIndex = 0;
    85     iArrayIndex = 0;
    86     iRefCount = 1;
    86     iRefCount = 1;
    87 
    87     iModeId = aModeId;
    88     }
    88     }
    89 
    89 
    90 
    90 
    91 // ---------------------------------------------------------------------------
    91 // ---------------------------------------------------------------------------
    92 // Two-Phased Constructor
    92 // Two-Phased Constructor
  1047 // Frees this object
  1047 // Frees this object
  1048 // ---------------------------------------------------------------------------
  1048 // ---------------------------------------------------------------------------
  1049 //
  1049 //
  1050 void CMPXCollectionUiHelperImp::Close()
  1050 void CMPXCollectionUiHelperImp::Close()
  1051     {
  1051     {
  1052 
  1052     if ( iModeId == KMcModeDefault )
  1053     ASSERT( iRefCount > 0 );
  1053         {
  1054     if ( --iRefCount == 0 )
  1054         ASSERT( iRefCount > 0 );
  1055         {
  1055         if ( --iRefCount == 0 )
  1056         // last client released
  1056             {
  1057         CMPXCollectionUiHelperImp* s = reinterpret_cast<CMPXCollectionUiHelperImp*>( Dll::Tls() );
  1057             // last client released
  1058         if ( s )
  1058             CMPXCollectionUiHelperImp* s = reinterpret_cast<CMPXCollectionUiHelperImp*>( Dll::Tls() );
  1059             {
  1059             if ( s && s == this )
  1060             if ( s == this )
       
  1061                 {
  1060                 {
  1062                 delete this;
  1061                 delete this;
  1063                 Dll::SetTls( NULL );
  1062                 Dll::SetTls( NULL );
  1064                 }
  1063                 }
  1065             }
  1064             }
       
  1065         }
       
  1066     else
       
  1067         {
       
  1068         delete this;
  1066         }
  1069         }
  1067     }
  1070     }
  1068 
  1071 
  1069 // ---------------------------------------------------------------------------
  1072 // ---------------------------------------------------------------------------
  1070 // Test if the specified title already exists for the category
  1073 // Test if the specified title already exists for the category