-
Notifications
You must be signed in to change notification settings - Fork 30k
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
timers: use HandleWrap::Unrefed #6381
Closed
Fishrock123
wants to merge
2
commits into
nodejs:master
from
Fishrock123:timers-use-handle-unrefed-check
Closed
timers: use HandleWrap::Unrefed #6381
Fishrock123
wants to merge
2
commits into
nodejs:master
from
Fishrock123:timers-use-handle-unrefed-check
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fishrock123
added
confirmed-bug
Issues with confirmed bugs.
c++
Issues and PRs that require attention from people who are familiar with C++.
timers
Issues and PRs related to the timers subsystem / setImmediate, setInterval, setTimeout.
labels
Apr 25, 2016
Been there done that ;-) ... LGTM if CI is green. |
diff --git a/src/handle_wrap.cc b/src/handle_wrap.cc
index 8421d694a991..bc02d7b8fdba 100644
--- a/src/handle_wrap.cc
+++ b/src/handle_wrap.cc
@@ -40,7 +40,7 @@ void HandleWrap::Unref(const FunctionCallbackInfo<Value>& args) {
void HandleWrap::Unrefed(const FunctionCallbackInfo<Value>& args) {
HandleWrap* wrap = Unwrap<HandleWrap>(args.Holder());
- bool unrefed = wrap->flags_ & kUnref == 1;
+ bool unrefed = IsAlive(wrap) && ((wrap->flags_ & kUnref) == 1);
args.GetReturnValue().Set(unrefed);
} fixes it (not sure if it’s semantically correct though). |
estliberitas
force-pushed
the
master
branch
2 times, most recently
from
April 26, 2016 05:23
7da4fd4
to
c7066fb
Compare
This reverts commit 9bb5a5e. Refs: nodejs#6395 Refs: nodejs#6204 Refs: nodejs#6401 Refs: nodejs#6382 Fixes: nodejs#6381 Conflicts: src/handle_wrap.cc test/parallel/test-handle-wrap-isrefed-tty.js test/parallel/test-handle-wrap-isrefed.js
3 tasks
Fishrock123
force-pushed
the
timers-use-handle-unrefed-check
branch
from
May 3, 2016 15:04
47343ef
to
9b62ab0
Compare
rebased on #6546 |
Fishrock123
added a commit
to Fishrock123/node
that referenced
this pull request
May 11, 2016
This reverts commit 9bb5a5e. This API is not suitable because it depended on being able to potentially access the handle's flag after the handle was already cleaned up. Since this is not actually possible (obviously, oops) this newer API no longer makes much sense, and the older API is more suitable. API comparison: IsRefed -> Has a strong reference AND is alive. (Deterministic) Unrefed -> Has a weak reference OR is dead. (Less deterministic) Refs: nodejs#6395 Refs: nodejs#6204 Refs: nodejs#6401 Refs: nodejs#6382 Fixes: nodejs#6381 PR-URL: nodejs#6546 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Trevor Norris <trev.norris@gmail.com> Conflicts: src/handle_wrap.cc test/parallel/test-handle-wrap-isrefed-tty.js test/parallel/test-handle-wrap-isrefed.js
Fishrock123
added a commit
to Fishrock123/node
that referenced
this pull request
May 11, 2016
Rename slightly to HasRef() at bnoordhuis’ request. Better reflects what we actually do for this check. Refs: nodejs#6395 Refs: nodejs#6204 Refs: nodejs#6401 Refs: nodejs#6382 Refs: nodejs#6381 PR-URL: nodejs#6546 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
evanlucas
pushed a commit
that referenced
this pull request
May 17, 2016
This reverts commit 9bb5a5e. This API is not suitable because it depended on being able to potentially access the handle's flag after the handle was already cleaned up. Since this is not actually possible (obviously, oops) this newer API no longer makes much sense, and the older API is more suitable. API comparison: IsRefed -> Has a strong reference AND is alive. (Deterministic) Unrefed -> Has a weak reference OR is dead. (Less deterministic) Refs: #6395 Refs: #6204 Refs: #6401 Refs: #6382 Fixes: #6381 PR-URL: #6546 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Trevor Norris <trev.norris@gmail.com> Conflicts: src/handle_wrap.cc test/parallel/test-handle-wrap-isrefed-tty.js test/parallel/test-handle-wrap-isrefed.js
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Checklist
Affected core subsystem(s)
timers
Description of change
See #6204 (comment) .. this patch crashes
test-handle-wrap-close-abort.js
with this error:refs: 9bb5a5e
(How do I keep getting this so wrong?? 😞)