The move-assignment operator in all three implementations now destroys the existing impl before taking ownership of other.impl, and guards against self-move-assignment.
Closes #54
The move-assignment operator in all three implementations now destroys the existing `impl` before taking ownership of `other.impl`, and guards against self-move-assignment.
The user-declared move-assignment operator overwrote `impl` without first
destroying the existing implementation object, leaking all memory and resources
owned by the left-hand side. Self-move-assignment also set `impl` to nullptr,
leaving the object invalid and leaking the old state.
Fix all three implementations (ConflictSet.cpp, SkipList.cpp, HashTable.cpp)
to guard against self-assignment and to destroy/free the old `impl` before
taking ownership of `other.impl`.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #54
The move-assignment operator in all three implementations now destroys the existing
implbefore taking ownership ofother.impl, and guards against self-move-assignment.2431f7db8ato4dc5f7f75c