mirror of
https://github.com/electron/electron.git
synced 2026-01-10 07:58:08 -05:00
fix: UvHandle move semantics (#43615)
reassign the uv_handle_t of the source
This commit is contained in:
@@ -62,8 +62,17 @@ class UvHandle {
|
||||
UvHandle() : t_{new T} {}
|
||||
~UvHandle() { reset(); }
|
||||
|
||||
UvHandle(UvHandle&&) = default;
|
||||
UvHandle& operator=(UvHandle&&) = default;
|
||||
explicit UvHandle(UvHandle&& that) {
|
||||
t_ = that.t_;
|
||||
that.t_ = nullptr;
|
||||
}
|
||||
|
||||
UvHandle& operator=(UvHandle&& that) {
|
||||
reset();
|
||||
t_ = that.t_;
|
||||
that.t_ = nullptr;
|
||||
return *this;
|
||||
}
|
||||
|
||||
UvHandle(const UvHandle&) = delete;
|
||||
UvHandle& operator=(const UvHandle&) = delete;
|
||||
|
||||
Reference in New Issue
Block a user