File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -555,7 +555,9 @@ class SessionShutdownWrap : public ReqWrap<uv_idle_t> {
555
555
class SessionSendBuffer : public WriteWrap {
556
556
public:
557
557
static void OnDone (WriteWrap* req, int status) {
558
- ::delete req;
558
+ SessionSendBuffer* wrap =
559
+ static_cast <SessionSendBuffer*>(req);
560
+ wrap->cleanup ();
559
561
}
560
562
561
563
SessionSendBuffer (Environment* env,
@@ -565,13 +567,15 @@ class SessionSendBuffer : public WriteWrap {
565
567
buffer_ = uv_buf_init (new char [size], size);
566
568
}
567
569
568
- ~SessionSendBuffer () {
569
- delete[] buffer_.base ;
570
- }
570
+ ~SessionSendBuffer () {}
571
571
572
572
uv_buf_t buffer_;
573
573
574
574
protected:
575
+ void cleanup () {
576
+ delete[] buffer_.base ;
577
+ }
578
+
575
579
// This is just to avoid the compiler error. This should not be called
576
580
void operator delete (void * ptr) { UNREACHABLE (); }
577
581
};
You can’t perform that action at this time.
0 commit comments