示例#1
0
void gt_layout_delete(GtLayout *layout)
{
  if (!layout) return;
  gt_rwlock_wrlock(layout->lock);
  if (layout->twc && layout->own_twc)
    gt_text_width_calculator_delete(layout->twc);
  gt_hashmap_delete(layout->tracks);
  gt_array_delete(layout->custom_tracks);
  if (layout->blocks)
    gt_hashmap_delete(layout->blocks);
  gt_rwlock_unlock(layout->lock);
  gt_rwlock_delete(layout->lock);
  gt_free(layout);
}
示例#2
0
void gt_diagram_delete(GtDiagram *diagram)
{
  if (!diagram) return;
  gt_rwlock_wrlock(diagram->lock);
  gt_array_delete(diagram->features);
  if (diagram->blocks)
    gt_hashmap_delete(diagram->blocks);
  gt_hashmap_delete(diagram->nodeinfo);
  gt_hashmap_delete(diagram->collapsingtypes);
  gt_hashmap_delete(diagram->groupedtypes);
  gt_hashmap_delete(diagram->caption_display_status);
  gt_array_delete(diagram->custom_tracks);
  gt_rwlock_unlock(diagram->lock);
  gt_rwlock_delete(diagram->lock);
  gt_free(diagram);
}
void gt_feature_index_delete(GtFeatureIndex *fi)
{
  if (!fi) return;
  gt_rwlock_wrlock(fi->pvt->lock);
  if (fi->pvt->reference_count) {
    fi->pvt->reference_count--;
    gt_rwlock_unlock(fi->pvt->lock);
    return;
  }
  gt_assert(fi->c_class);
  if (fi->c_class->free)
    fi->c_class->free(fi);
  gt_rwlock_unlock(fi->pvt->lock);
  gt_rwlock_delete(fi->pvt->lock);
  gt_free(fi->pvt);
  gt_free(fi);
}