-
Notifications
You must be signed in to change notification settings - Fork 371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wapped curl multi handle #2459
Wapped curl multi handle #2459
Conversation
5bb7893
to
43db0ba
Compare
* CURLReference * | ||
*****************/ | ||
|
||
CURLReference::CURLReference(CURL* handle) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that in other wrappers we have been using .raw()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oups, this should be pointing at the unwrap
line, sorry
|
||
CURLMultiHandle& CURLMultiHandle::operator=(CURLMultiHandle&& rhs) | ||
{ | ||
std::swap(p_handle, rhs.p_handle); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldnt we set rhs
in a non-owning state? Just swapping here will make it own what we have, it might not be immediately destroyed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's ok to have rhs freeing the curl handle in its destructor later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah but is it ok if it's not called immediately and rhs is still a valid usable object and is used before being destroyed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the object it is swapped with is in a valid state as soon as it has been constructed.
d50d03b
to
6b243e1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
No description provided.