Changeset 2170

Show
Ignore:
Timestamp:
09/21/08 22:46:28 (4 months ago)
Author:
karpet
Message:

do not call mem check at s3 destroy unless are children are explicitly destroyed. helps reduce noise in perl bindings (for one)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • libswish3/trunk/src/libswish3/swish.c

    r2158 r2170  
    5555) 
    5656{ 
     57    boolean children_are_freed; 
     58     
     59    children_are_freed = 0; 
    5760    s3->parser->ref_cnt--; 
    5861    if (s3->parser->ref_cnt < 1) { 
    5962        swish_free_parser(s3->parser); 
     63        children_are_freed++; 
    6064    } 
    6165 
     
    6367    if (s3->analyzer->ref_cnt < 1) { 
    6468        swish_free_analyzer(s3->analyzer); 
     69        children_are_freed++; 
    6570    } 
    6671 
     
    6873    if (s3->config->ref_cnt < 1) { 
    6974        swish_free_config(s3->config); 
     75        children_are_freed++; 
    7076    } 
    7177 
     
    7480    } 
    7581    swish_xfree(s3); 
    76     swish_mem_debug(); 
     82     
     83    if (children_are_freed == 3) { 
     84        swish_mem_debug(); 
     85    } 
    7786} 
    7887