Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
src: use smart pointer in UDPWrap::OnSend
  • Loading branch information
danbev committed Feb 21, 2019
commit 2589f8917c63f1a75f9a5fe78775874ff891f362
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