// Assignment operator Auth2Certificate& Auth2Certificate::operator=(const Auth2Certificate& theCertR) { if (this != &theCertR) // protect vs a = a { AuthCertificateBase::operator=(theCertR); mUserName = theCertR.mUserName; FreeDataList(); AppendDataList( theCertR.mDataList ); // deep copy } return *this; }
/* Free the allocated memory */ static void FreeMemory( void ) { UInt16 i; for ( i = 0; i < NUM_OF_BUTTONS; i++ ) { if ( buttonList[ i ].recordText != NULL ) MemPtrFree( buttonList[ i ].recordText ); if ( buttonList[ i ].sizeText != NULL ) MemPtrFree( buttonList[ i ].sizeText ); } /* Free the linked list generated by EnumerateData() */ FreeDataList(); }
// Default constructor Auth2Certificate::~Auth2Certificate() { FreeDataList(); }