http2,tls: store WriteWrap using BaseObjectPtr
Create weak WriteWrap
and ShutdownWrap
objects, and when
referencing them in C++ is necessary, use BaseObjectPtr<>
instead of plain pointers to keep these objects from being
garbage-collected.
This solves issues that arise when the underlying StreamBase
instance is weak, but the WriteWrap
or ShutdownWrap
instances
are not; in that case, they would otherwise potentially stick
around in memory after the stream that they originally belong
to is long gone.
It probably makes sense to use BaseObjectptr<>
more extensively
in StreamBase
in the long run as well.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows commit guidelines