Closed Blzut3 closed 2 years ago
@abedra Do you have any comments on this change?
@abedra Do you have any comments on this change?
Apologies for losing track of this one. I understand your point and agree that this could lead to undesired impact. Going to take another look through this and consider a couple different paths as well
I ended up going a little further on this idea and completely encapsulated the underlying curl pieces. The resulting commit is at d47c31eb01d51b7cd142b6c4ef893f604914c497. Thanks for pointing this out, I do think this was a necessary improvement.
Thanks for getting this resolved! Will try it out soon. (Nitpick: you probably could have just used a stack allocated CurlWrapper instead of unique_ptr.)
Yeah, fair point on the stack allocation vs the unique_ptr
. Things morphed a bit throughout the lifecycle of the PR and now that it's all settled it does appear safe to move in that direction.
This prevents memory leaks if the callbacks throw exceptions (most notably the errorCallback).