Skip to content

Conversation

@danbev
Copy link
Contributor

This change was suggested by bnoordhuis in the following comment:
#9163 (comment)

Not including any tests as this is covered by test/addons/at-exit.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

src

@nodejs-github-botnodejs-github-bot added the c++ Issues and PRs that require attention from people who are familiar with C++. label Apr 6, 2017
@danbev
Copy link
ContributorAuthor

@mscdexmscdex added the process Issues and PRs related to the process subsystem. label Apr 6, 2017
src/node.cc Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use AtExitCallback not a pointer-to-AtExitCallback. It's leaking memory now in RunAtExit().

(Tiny nit: it should really be called at_exit_functions, it's not a class member.)

src/node.cc Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style: at_exit

src/node.cc Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, maybe call this at_exit for consistency.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah good point, will change that. Thanks!

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is using an anonymous object something considered ok to do?

at_exit_functions.push_back(AtExitCallback{cb, arg});

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's fine.

@danbev
Copy link
ContributorAuthor

This change was suggested by bnoordhuis in the following comment: nodejs#9163 (comment) Not including any tests as this is covered by test/addons/at-exit.
@danbev
Copy link
ContributorAuthor

danbev added a commit to danbev/node that referenced this pull request Apr 10, 2017
This change was suggested by bnoordhuis in the following comment: nodejs#9163 (comment) Not including any tests as this is covered by test/addons/at-exit. PR-URL: nodejs#12255 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
@danbev
Copy link
ContributorAuthor

Landed in fe016c6

@danbevdanbev closed this Apr 10, 2017
italoacasas pushed a commit to italoacasas/node that referenced this pull request Apr 10, 2017
This change was suggested by bnoordhuis in the following comment: nodejs#9163 (comment) Not including any tests as this is covered by test/addons/at-exit. PR-URL: nodejs#12255 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
@italoacasasitaloacasas mentioned this pull request Apr 10, 2017
2 tasks
@danbevdanbev deleted the atexit-list branch April 13, 2017 11:31
@MylesBorins
Copy link
Contributor

Should this be cherry-picked to v6.x? It lands cleanly fwiw

@danbev
Copy link
ContributorAuthor

@MylesBorins Not sure as it is a minor improvement, but if it lands cleanly I see no harm in that. Let me know if you'd like me to create a PR against v6.x-staging. Thanks

MylesBorins pushed a commit that referenced this pull request May 15, 2017
This change was suggested by bnoordhuis in the following comment: #9163 (comment) Not including any tests as this is covered by test/addons/at-exit. PR-URL: #12255 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
@MylesBorinsMylesBorins mentioned this pull request May 23, 2017
andrew749 pushed a commit to michielbaird/node that referenced this pull request Jul 19, 2017
This change was suggested by bnoordhuis in the following comment: nodejs/node#9163 (comment) Not including any tests as this is covered by test/addons/at-exit. PR-URL: nodejs/node#12255 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++Issues and PRs that require attention from people who are familiar with C++.processIssues and PRs related to the process subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants

@danbev@MylesBorins@bnoordhuis@addaleax@cjihrig@richardlau@mscdex@nodejs-github-bot