-
-static void recursiveDestroyContainer (container_t container)
-{
- if (container == nullptr){
- THROWF (tracing_error, 0, "trying to recursively destroy a nullptr container");
- }
- XBT_DEBUG("recursiveDestroyContainer %s", container->name_.c_str());
- for (auto child : container->children_) {
- recursiveDestroyContainer(child.second);
- }
- delete container;
-}
-
-void PJ_container_free_all ()
-{
- container_t root = PJ_container_get_root();
- if (root == nullptr){
- THROWF (tracing_error, 0, "trying to free all containers, but root is nullptr");
- }
- recursiveDestroyContainer (root);
- rootContainer = nullptr;
-
- //checks
- if (not allContainers.empty()) {
- THROWF(tracing_error, 0, "some containers still present even after destroying all of them");
- }
-}