LOCKING: must be called with lock taken
| 699 | |
| 700 | // LOCKING: must be called with lock taken |
| 701 | void |
| 702 | HttpBodyFactory::nuke_template_tables() |
| 703 | { |
| 704 | if (table_of_sets) { |
| 705 | Dbg(dbg_ctl_body_factory, "deleting pre-existing template tables"); |
| 706 | } else { |
| 707 | Dbg(dbg_ctl_body_factory, "no pre-existing template tables"); |
| 708 | } |
| 709 | if (table_of_sets) { |
| 710 | /////////////////////////////////////////// |
| 711 | // loop over set->body-types hash table // |
| 712 | /////////////////////////////////////////// |
| 713 | for (const auto &it : *table_of_sets.get()) { |
| 714 | HttpBodySet *body_set = static_cast<HttpBodySet *>(it.second); |
| 715 | ink_assert(body_set->is_sane()); |
| 716 | if (body_set->table_of_pages) { |
| 717 | /////////////////////////////////////////// |
| 718 | // loop over body-types->body hash table // |
| 719 | /////////////////////////////////////////// |
| 720 | for (const auto &it_page : *body_set->table_of_pages.get()) { |
| 721 | delete it_page.second; |
| 722 | } |
| 723 | body_set->table_of_pages.reset(nullptr); |
| 724 | } |
| 725 | delete body_set; |
| 726 | } |
| 727 | table_of_sets.reset(nullptr); |
| 728 | } |
| 729 | } |
| 730 | |
| 731 | // LOCKING: must be called with lock taken |
| 732 | std::unique_ptr<HttpBodyFactory::BodySetTable> |