Esempio n. 1
0
/* Function:  free_GeneModel(obj)
 *
 * Descrip:    Free Function: removes the memory held by obj
 *             Will chain up to owned members and clear all lists
 *
 *
 * Arg:        obj [UNKN ] Object that is free'd [GeneModel *]
 *
 * Return [UNKN ]  Undocumented return value [GeneModel *]
 *
 */
GeneModel * free_GeneModel(GeneModel * obj) 
{


    if( obj == NULL) {  
      warn("Attempting to free a NULL pointer to a GeneModel obj. Should be trappable"); 
      return NULL;   
      }  


    if( obj->dynamite_hard_link > 1)     {  
      obj->dynamite_hard_link--; 
      return NULL;   
      }  
    if( obj->splice5 != NULL)    
      free_pwmDNA(obj->splice5);     
    if( obj->splice3 != NULL)    
      free_pwmDNA(obj->splice3);     
    if( obj->intron != NULL) 
      free_RandomModelDNA(obj->intron);  
    if( obj->polyp != NULL)  
      free_RandomModelDNA(obj->polyp);   
    if( obj->rnd != NULL)    
      free_RandomModelDNA(obj->rnd);     
    if( obj->splice5score != NULL)   
      free_SpliceSiteScore(obj->splice5score);   
    if( obj->splice3score != NULL)   
      free_SpliceSiteScore(obj->splice3score);   


    ckfree(obj); 
    return NULL; 
}    
Esempio n. 2
0
/* Function:  free_GeneStats(obj)
 *
 * Descrip:    Free Function: removes the memory held by obj
 *             Will chain up to owned members and clear all lists
 *
 *
 * Arg:        obj [UNKN ] Object that is free'd [GeneStats *]
 *
 * Return [UNKN ]  Undocumented return value [GeneStats *]
 *
 */
GeneStats * free_GeneStats(GeneStats * obj) 
{


    if( obj == NULL) {  
      warn("Attempting to free a NULL pointer to a GeneStats obj. Should be trappable"); 
      return NULL;   
      }  


    if( obj->dynamite_hard_link > 1)     {  
      obj->dynamite_hard_link--; 
      return NULL;   
      }  
    if( obj->splice5 != NULL)    
      free_SeqAlign(obj->splice5);   
    if( obj->splice3 != NULL)    
      free_SeqAlign(obj->splice3);   
    if( obj->intron != NULL) 
      free_RandomModelDNA(obj->intron);  
    if( obj->polyp != NULL)  
      free_RandomModelDNA(obj->polyp);   
    if( obj->rnd != NULL)    
      free_RandomModelDNA(obj->rnd);     


    ckfree(obj); 
    return NULL; 
}    
Esempio n. 3
0
/* Function:  free_GeneModel(obj)
 *
 * Descrip:    Free Function: removes the memory held by obj
 *             Will chain up to owned members and clear all lists
 *
 *
 * Arg:        obj [UNKN ] Object that is free'd [GeneModel *]
 *
 * Return [UNKN ]  Undocumented return value [GeneModel *]
 *
 */
GeneModel * free_GeneModel(GeneModel * obj) 
{
    int return_early = 0;    


    if( obj == NULL) {  
      warn("Attempting to free a NULL pointer to a GeneModel obj. Should be trappable"); 
      return NULL;   
      }  


#ifdef PTHREAD   
    assert(pthread_mutex_lock(&(obj->dynamite_mutex)) == 0); 
#endif   
    if( obj->dynamite_hard_link > 1)     {  
      return_early = 1;  
      obj->dynamite_hard_link--; 
      }  
#ifdef PTHREAD   
    assert(pthread_mutex_unlock(&(obj->dynamite_mutex)) == 0);   
#endif   
    if( return_early == 1)   
      return NULL;   
    if( obj->splice5 != NULL)    
      free_pwmDNA(obj->splice5);     
    if( obj->splice3 != NULL)    
      free_pwmDNA(obj->splice3);     
    if( obj->intron != NULL) 
      free_RandomModelDNA(obj->intron);  
    if( obj->polyp != NULL)  
      free_RandomModelDNA(obj->polyp);   
    if( obj->rnd != NULL)    
      free_RandomModelDNA(obj->rnd);     
    if( obj->splice5score != NULL)   
      free_SpliceSiteScore(obj->splice5score);   
    if( obj->splice3score != NULL)   
      free_SpliceSiteScore(obj->splice3score);   


    ckfree(obj); 
    return NULL; 
}    
Esempio n. 4
0
boolean free_io_objects(void)
{
  if( use_tsm == TRUE) {
    free_ThreeStateModel(tsm);
  } else {
    free_Protein(pro);
  }

  free_CodonTable(ct);
  if( gf != NULL ) {
    free_GeneFrequency21(gf);
  }
  free_RandomModelDNA(rmd);
  if( is_embl ) {
    free_GenomicRegion(embl);
  } 
  free_Genomic(gen);
  

  return TRUE;
}
Esempio n. 5
0
    /* Function:  free_DnaProfileEnginePara(obj)
     *
     * Descrip:    Free Function: removes the memory held by obj
     *             Will chain up to owned members and clear all lists
     *
     *
     * Arg:        obj [UNKN ] Object that is free'd [DnaProfileEnginePara *]
     *
     * Return [UNKN ]  Undocumented return value [DnaProfileEnginePara *]
     *
     */
    DnaProfileEnginePara * free_DnaProfileEnginePara(DnaProfileEnginePara * obj)
    {
        int return_early = 0;


        if( obj == NULL) {
            warn("Attempting to free a NULL pointer to a DnaProfileEnginePara obj. Should be trappable");
            return NULL;
        }


#ifdef PTHREAD
        assert(pthread_mutex_lock(&(obj->dynamite_mutex)) == 0);
#endif
        if( obj->dynamite_hard_link > 1)     {
            return_early = 1;
            obj->dynamite_hard_link--;
        }
#ifdef PTHREAD
        assert(pthread_mutex_unlock(&(obj->dynamite_mutex)) == 0);
#endif
        if( return_early == 1)
            return NULL;
        if( obj->dpri != NULL)
            free_DPRunImpl(obj->dpri);
        if( obj->rm != NULL)
            free_RandomModelDNA(obj->rm);
        if( obj->setpara != NULL)
            free_LocalCisHitSetPara(obj->setpara);
        if( obj->lchs != NULL)
            free_LocalCisHitScore(obj->lchs);


        ckfree(obj);
        return NULL;
    }