-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tls: follow up for #5168 #5169
tls: follow up for #5168 #5169
Conversation
Invoke `close_cb` on `~StreamResource`, it will be used to unconsume streams on destruction.
When parent stream is destroyed - remove references to it, and error when attempting to access its properties.
EDIT: 6807dc1 fixes that. |
Adding nullptr checks everywhere is often an indication that one needs to rethink their object life cycle management... IOW, is this really the best possible fix? |
@bnoordhuis yeah, there are conceptual problems that I haven't really figured out a best solution for yet. Perhaps, we could try to brainstorm it here together? So basically the current scheme involves two objects: Why is cross-reference even needed? This is the way So the solution should either be re-thinking the StreamBase, making their lifetimes match, or adding close callback as in this PR. I have no ideas for StreamBase re-thinking, it seems that matching lifetimes will very likely kill the reason why @bnoordhuis do you have any ideas? |
@bnoordhuis ... ping |
No concrete suggestions, but I suspect a more rigorous refactoring is in order. This PR is really just a band-aid; it might be a quick fix but piling on workarounds doesn't result in maintainable software. |
7da4fd4
to
c7066fb
Compare
c133999
to
83c7a88
Compare
ping @indutny ... do you still want to pursue this? |
Feel free to reopen this PR if you get back to working on it. |
This is a promised follow-up for #5168 PR.
cc @nodejs/crypto
R = @bnoordhuis