GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — src: make req_wrap a unique_ptr in AfterConnect · nodejs/node@20a4f14

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • connection_wrap.cc
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/connection_wrap.cc‎

Copy file name to clipboardExpand all lines: src/connection_wrap.cc
+2-3Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ void ConnectionWrap<WrapType, UVType>::OnConnection(uv_stream_t* handle,
7777
template <typename WrapType, typename UVType>
7878
void ConnectionWrap<WrapType, UVType>::AfterConnect(uv_connect_t* req,
7979
int status) {
80-
ConnectWrap* req_wrap = static_cast<ConnectWrap*>(req->data);
80+
std::unique_ptr<ConnectWrap> req_wrap
81+
(static_cast<ConnectWrap*>(req->data));
8182
CHECK_NOT_NULL(req_wrap);
8283
WrapType* wrap = static_cast<WrapType*>(req->handle->data);
8384
CHECK_EQ(req_wrap->env(), wrap->env());
@@ -108,8 +109,6 @@ void ConnectionWrap<WrapType, UVType>::AfterConnect(uv_connect_t* req,
108109
};
109110

110111
req_wrap->MakeCallback(env->oncomplete_string(), arraysize(argv), argv);
111-
112-
delete req_wrap;
113112
}
114113

115114
template ConnectionWrap<PipeWrap, uv_pipe_t>::ConnectionWrap(

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.