Skip to content

Commit

Permalink
src: use smart pointer in UDPWrap::OnSend
Browse files Browse the repository at this point in the history
PR-URL: #26233
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
danbev authored and rvagg committed Feb 28, 2019
1 parent d915207 commit 68accb5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/udp_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ void UDPWrap::RecvStop(const FunctionCallbackInfo<Value>& args) {


void UDPWrap::OnSend(uv_udp_send_t* req, int status) {
SendWrap* req_wrap = static_cast<SendWrap*>(req->data);
std::unique_ptr<SendWrap> req_wrap{static_cast<SendWrap*>(req->data)};
if (req_wrap->have_callback()) {
Environment* env = req_wrap->env();
HandleScope handle_scope(env->isolate());
Expand All @@ -455,7 +455,6 @@ void UDPWrap::OnSend(uv_udp_send_t* req, int status) {
};
req_wrap->MakeCallback(env->oncomplete_string(), 2, arg);
}
delete req_wrap;
}


Expand Down

0 comments on commit 68accb5

Please sign in to comment.