diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2023-05-26 14:42:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-26 14:42:00 +0200 |
commit | 17f53418cfaaf49b87f06123af0aaf73f3593fe8 (patch) | |
tree | 4f4229d8a8f417d3109564b7195c96cf5807907e | |
parent | c6b284e4ab327671d811f468aa3291b116015f9d (diff) | |
parent | b3163c6e8af490755eb5b7675e3faee2d28d4c7c (diff) |
Merge pull request #27224 from vespa-engine/balder/ensure-safe-destruction-order
Ensure correct destruction order to uphold life time guarantees.
-rw-r--r-- | searchcore/src/vespa/searchcore/proton/matching/search_session.cpp | 4 | ||||
-rw-r--r-- | searchcore/src/vespa/searchcore/proton/matching/search_session.h | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/matching/search_session.cpp b/searchcore/src/vespa/searchcore/proton/matching/search_session.cpp index a2e0cfd5d8e..c69887af1ec 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/search_session.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/search_session.cpp @@ -25,8 +25,8 @@ SearchSession::~SearchSession() = default; SearchSession::OwnershipBundle::OwnershipBundle(MatchContext && match_context, std::shared_ptr<const ISearchHandler> searchHandler) noexcept - : context(std::move(match_context)), - search_handler(std::move(searchHandler)), + : search_handler(std::move(searchHandler)), + context(std::move(match_context)), feature_overrides(), readGuard() {} diff --git a/searchcore/src/vespa/searchcore/proton/matching/search_session.h b/searchcore/src/vespa/searchcore/proton/matching/search_session.h index d219682baf2..3775759126f 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/search_session.h +++ b/searchcore/src/vespa/searchcore/proton/matching/search_session.h @@ -28,8 +28,9 @@ public: OwnershipBundle(OwnershipBundle &&) noexcept = default; OwnershipBundle & operator = (OwnershipBundle &&) noexcept = delete; ~OwnershipBundle(); - MatchContext context; + // Note that SearchHandler must above the other members due to life time guarantees. std::shared_ptr<const ISearchHandler> search_handler; + MatchContext context; std::unique_ptr<search::fef::Properties> feature_overrides; IDocumentMetaStoreContext::IReadGuard::SP readGuard; }; |