Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 68accb5

Browse filesBrowse files
danbevrvagg
authored andcommitted
src: use smart pointer in UDPWrap::OnSend
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>
1 parent d915207 commit 68accb5
Copy full SHA for 68accb5

File tree

Expand file treeCollapse file tree

1 file changed

+1
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-2
lines changed
Open diff view settings
Collapse file

‎src/udp_wrap.cc‎

Copy file name to clipboardExpand all lines: src/udp_wrap.cc
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ void UDPWrap::RecvStop(const FunctionCallbackInfo<Value>& args) {
444444

445445

446446
void UDPWrap::OnSend(uv_udp_send_t* req, int status) {
447-
SendWrap* req_wrap = static_cast<SendWrap*>(req->data);
447+
std::unique_ptr<SendWrap> req_wrap{static_cast<SendWrap*>(req->data)};
448448
if (req_wrap->have_callback()) {
449449
Environment* env = req_wrap->env();
450450
HandleScope handle_scope(env->isolate());
@@ -455,7 +455,6 @@ void UDPWrap::OnSend(uv_udp_send_t* req, int status) {
455455
};
456456
req_wrap->MakeCallback(env->oncomplete_string(), 2, arg);
457457
}
458-
delete req_wrap;
459458
}
460459

461460

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.