Skip to content

Commit 5f17ac4

Browse files
committed
http2: fixup SessionSendBuffer impl (Squash)
The WriteWrap impl details changed slightly. Fixup the cleanup logic for SessionSendBuffer class in node_http2.h accordingly.
1 parent 7f99a4a commit 5f17ac4

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/node_http2.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,9 @@ class SessionShutdownWrap : public ReqWrap<uv_idle_t> {
555555
class SessionSendBuffer : public WriteWrap {
556556
public:
557557
static void OnDone(WriteWrap* req, int status) {
558-
::delete req;
558+
SessionSendBuffer* wrap =
559+
static_cast<SessionSendBuffer*>(req);
560+
wrap->cleanup();
559561
}
560562

561563
SessionSendBuffer(Environment* env,
@@ -565,13 +567,15 @@ class SessionSendBuffer : public WriteWrap {
565567
buffer_ = uv_buf_init(new char[size], size);
566568
}
567569

568-
~SessionSendBuffer() {
569-
delete[] buffer_.base;
570-
}
570+
~SessionSendBuffer() {}
571571

572572
uv_buf_t buffer_;
573573

574574
protected:
575+
void cleanup() {
576+
delete[] buffer_.base;
577+
}
578+
575579
// This is just to avoid the compiler error. This should not be called
576580
void operator delete(void* ptr) { UNREACHABLE(); }
577581
};

0 commit comments

Comments
 (0)