/* Function:  free_ModuleInfo(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 [ModuleInfo *]
 *
 * Return [UNKN ]  Undocumented return value [ModuleInfo *]
 *
 */
ModuleInfo * free_ModuleInfo(ModuleInfo * obj) 
{
    int return_early = 0;    


    if( obj == NULL) {  
      warn("Attempting to free a NULL pointer to a ModuleInfo 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->ft != NULL) 
      free_Ftext(obj->ft);   


    ckfree(obj); 
    return NULL; 
}    
Beispiel #2
0
/* Function:  free_FuncInfo(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 [FuncInfo *]
 *
 * Return [UNKN ]  Undocumented return value [FuncInfo *]
 *
 */
FuncInfo * free_FuncInfo(FuncInfo * obj) 
{
    int i;   


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


    if( obj->dynamite_hard_link > 1)     {  
      obj->dynamite_hard_link--; 
      return NULL;   
      }  
    if( obj->name != NULL)   
      ckfree(obj->name);     
    if( obj->type != NULL)   
      ckfree(obj->type);     
    if( obj->complete_name != NULL)  
      ckfree(obj->complete_name);    
    if( obj->stripped_return != NULL)    
      ckfree(obj->stripped_return);  
    if( obj->ft != NULL) 
      free_Ftext(obj->ft);   
    if( obj->error != NULL)  
      ckfree(obj->error);    
    if( obj->arg != NULL)    {  
      for(i=0;i<obj->len;i++)    {  
        if( obj->arg[i] != NULL) 
          free_ArgInfo(obj->arg[i]); 
        }  
      ckfree(obj->arg);  
      }  
    if( obj->err != NULL)    {  
      for(i=0;i<obj->err_len;i++)    {  
        if( obj->err[i] != NULL) 
          free_ErrorInfo(obj->err[i]);   
        }  
      ckfree(obj->err);  
      }  
    if( obj->sdesc != NULL)  
      ckfree(obj->sdesc);    
    if( obj->ret != NULL)    
      free_ArgInfo(obj->ret);    
    if( obj->simple != NULL) 
      ckfree(obj->simple);   


    ckfree(obj); 
    return NULL; 
}    
Beispiel #3
0
/* Function:  free_ModuleInfo(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 [ModuleInfo *]
 *
 * Return [UNKN ]  Undocumented return value [ModuleInfo *]
 *
 */
ModuleInfo * free_ModuleInfo(ModuleInfo * obj) 
{


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


    if( obj->dynamite_hard_link > 1)     {  
      obj->dynamite_hard_link--; 
      return NULL;   
      }  
    if( obj->ft != NULL) 
      free_Ftext(obj->ft);   


    ckfree(obj); 
    return NULL; 
}