| 605 | } |
| 606 | |
| 607 | std::shared_ptr<void> SessionManager::parserKeepaliveForObjectTopic(ObjectTopicId id) const { |
| 608 | // shared_ptr<MessageParserHandle> -> shared_ptr<void>: holding it keeps the |
| 609 | // handle (and thus the parser instance + plugin DSO) alive for the consumer. |
| 610 | std::shared_lock lock(object_parsers_mutex_); |
| 611 | const auto* slot = findValidParserSlotLocked(id); |
| 612 | return slot != nullptr ? slot->handle : nullptr; |
| 613 | } |
| 614 | |
| 615 | MessageParserPluginBase* SessionManager::parserForObjectTopic(ObjectTopicId id) const { |
| 616 | // Returns a RAW pointer with no keepalive: only safe for synchronous GUI-thread |