| 665 | } |
| 666 | |
| 667 | void SessionManager::clearAllObjects() { |
| 668 | object_store_.clear(); |
| 669 | // Swap the map into a local under the lock, then let it destruct after the |
| 670 | // lock releases — slot dtors may run plugin teardown (dlclose). |
| 671 | std::unordered_map<uint32_t, ObjectParserSlot> drained; |
| 672 | { |
| 673 | std::unique_lock lock(object_parsers_mutex_); |
| 674 | drained.swap(object_topic_parsers_); |
| 675 | } |
| 676 | // drained destructs here, after the lock is released. |
| 677 | } |
| 678 | |
| 679 | } // namespace PJ |