void CSequence::Delete() { while(m_comments != NULL) { CComment* curComment = m_comments; m_comments = curComment->GetNext(); curComment->Delete(); } if (m_path != NULL) { free(m_path); m_path = NULL; } if (m_name != NULL) { free(m_name); m_name = NULL; } if (m_action != NULL) { free(m_action); m_action = NULL; } if (m_sound != NULL) { free(m_sound); m_sound = NULL; } // now a cstring // if (m_enum != NULL) // { // free(m_enum); // m_enum = NULL; // } for (int i=0; i<MAX_ADDITIONAL_SEQUENCES; i++) { if (AdditionalSeqs[i]) { AdditionalSeqs[i]->Delete(); AdditionalSeqs[i] = NULL; } } delete this; }
void CModel::Delete() { while(m_comments != NULL) { CComment* curComment = m_comments; m_comments = curComment->GetNext(); curComment->Delete(); } while(m_sequences != NULL) { CSequence* curSequence = m_sequences; m_sequences = curSequence->GetNext(); curSequence->Delete(); } if (m_name != NULL) { free(m_name); m_name = NULL; } if (m_path != NULL) { free(m_path); m_path = NULL; } if (m_psSkelPath != NULL) { free(m_psSkelPath); m_psSkelPath = NULL; } if (m_psMakeSkelPath != NULL) { free(m_psMakeSkelPath); m_psMakeSkelPath = NULL; } if (m_psRefGLAPath != NULL) { free(m_psRefGLAPath); m_psRefGLAPath = NULL; } m_curSequence = NULL; PCJList_Clear(); // not really necessary, but useful reminder delete this; }