// file: tp_cstr_0.cc
//

// isip include files
//
#include "trace_projector.h"
 
// method: constructor
//
// arguments: none
//
// return: none
//
// this is the default constructor for the class
//
Trace_projector::~Trace_projector() {

  // free decoder
  //
  delete decoder_d;
  
  // free memory
  //
  if (monophones_file_d != (char_1*)NULL) {
    delete [] monophones_file_d;
    monophones_file_d = (char_1*)NULL;
  }

  if (lexicon_file_d != (char_1*)NULL) {
    delete [] lexicon_file_d;
    lexicon_file_d = (char_1*)NULL;
  }

  if (lattice_file_d != (char_1*)NULL) {
    delete [] lattice_file_d;
    lattice_file_d = (char_1*)NULL;
  }
  
  if (forcealign_file_d != (char_1*)NULL) {
    delete [] forcealign_file_d;
    forcealign_file_d = (char_1*)NULL;
  }
  
  if (latwer_file_d != (char_1*)NULL) {
    delete [] latwer_file_d;
    latwer_file_d = (char_1*)NULL;
  }
  
  if (transitions_file_d != (char_1*)NULL) {
    delete [] transitions_file_d;
    transitions_file_d = (char_1*)NULL;
  }
  
  if (states_file_d != (char_1*)NULL) {
    delete [] states_file_d;
    states_file_d = (char_1*)NULL;
  }
  
  if (models_file_d != (char_1*)NULL) {
    delete [] models_file_d;
    models_file_d = (char_1*)NULL;
  }
  
  if (phones_file_d != (char_1*)NULL) {
    delete [] phones_file_d;
    phones_file_d = (char_1*)NULL;  
  }
  
  if (lm_file_d != (char_1*)NULL) {
    delete [] lm_file_d;
    lm_file_d = (char_1*)NULL;
  }

  if (gram_list_file_d != (char_1*)NULL) {
    delete [] gram_list_file_d;
    gram_list_file_d = (char_1*)NULL;
  }
  
  if (input_file_d != (char_1*)NULL) {
    delete [] input_file_d;
    input_file_d = (char_1*)NULL;
  }
  
  if (output_file_d != (char_1*)NULL) {
    delete [] output_file_d;
    output_file_d = (char_1*)NULL;
  }

  if (outnbest_file_d != (char_1*)NULL) {
    delete [] outnbest_file_d;
    outnbest_file_d = (char_1*)NULL;
  }
  
  if (lattice_file_d != (char_1*)NULL) {
    delete [] lattice_file_d;
    lattice_file_d = (char_1*)NULL;
  }
  
  if (outlat_file_d != (char_1*)NULL) {
    delete [] outlat_file_d;
    outlat_file_d = (char_1*)NULL;
  }
  
  if (forcealign_file_d != (char_1*)NULL) {
    delete [] forcealign_file_d;
    forcealign_file_d = (char_1*)NULL;
  }

  if (beam_width_d != (float_4*)NULL) {
    delete [] beam_width_d;
    beam_width_d = (float_4*)NULL;
  }
  
  if (frontend_params_d != (char_1*)NULL) {
    delete [] frontend_params_d;
    frontend_params_d = (char_1*)NULL;
  }

  // exit gracefully
  //
}
