Merge pull request 'Fix move-assignment leak and self-assignment in ConflictSet' (#55) from weaselbot/conflict-set:weaselbot/issue-54 into main

Reviewed-on: #55
This commit is contained in:
2026-07-14 10:56:12 -04:00
committed by andrew
parent c11b4714b5
commit a69dac7f16
3 changed files with 19 additions and 3 deletions
+6 -1
View File
@@ -903,7 +903,12 @@ ConflictSet::ConflictSet(ConflictSet &&other) noexcept
: impl(std::exchange(other.impl, nullptr)) {}
ConflictSet &ConflictSet::operator=(ConflictSet &&other) noexcept {
impl = std::exchange(other.impl, nullptr);
if (this != &other) {
if (impl) {
internal_destroy(impl);
}
impl = std::exchange(other.impl, nullptr);
}
return *this;
}