We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d915207 commit 68accb5Copy full SHA for 68accb5
src/udp_wrap.cc
@@ -444,7 +444,7 @@ void UDPWrap::RecvStop(const FunctionCallbackInfo<Value>& args) {
444
445
446
void UDPWrap::OnSend(uv_udp_send_t* req, int status) {
447
- SendWrap* req_wrap = static_cast<SendWrap*>(req->data);
+ std::unique_ptr<SendWrap> req_wrap{static_cast<SendWrap*>(req->data)};
448
if (req_wrap->have_callback()) {
449
Environment* env = req_wrap->env();
450
HandleScope handle_scope(env->isolate());
@@ -455,7 +455,6 @@ void UDPWrap::OnSend(uv_udp_send_t* req, int status) {
455
};
456
req_wrap->MakeCallback(env->oncomplete_string(), 2, arg);
457
}
458
- delete req_wrap;
459
460
461
0 commit comments