Title: Memory management questions · Issue #550 · nodejs/node-addon-api · GitHub
Open Graph Title: Memory management questions · Issue #550 · nodejs/node-addon-api
X Title: Memory management questions · Issue #550 · nodejs/node-addon-api
Description: I see that SuppressDestructor is used often in the object wrap examples, like: https://github.com/nodejs/node-addon-api/blob/master/doc/object_wrap.md // Call the SuppressDestruct() method on the static data prevent the calling // to thi...
Open Graph Description: I see that SuppressDestructor is used often in the object wrap examples, like: https://github.com/nodejs/node-addon-api/blob/master/doc/object_wrap.md // Call the SuppressDestruct() method on the s...
X Description: I see that SuppressDestructor is used often in the object wrap examples, like: https://github.com/nodejs/node-addon-api/blob/master/doc/object_wrap.md // Call the SuppressDestruct() method on the s...
Opengraph URL: https://github.com/nodejs/node-addon-api/issues/550
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Memory management questions","articleBody":"1. I see that `SuppressDestructor` is used often in the object wrap examples, like:\r\nhttps://github.com/nodejs/node-addon-api/blob/master/doc/object_wrap.md\r\n```\r\n // Call the SuppressDestruct() method on the static data prevent the calling\r\n // to this destructor to reset the reference when the environment is no longer\r\n // available.\r\n constructor.SuppressDestruct();\r\n```\r\nBut what exactly means this comment? I honestly don't understand if I have to manage the life cycle of any object created by this code.\r\n2. Similarly if using a `Napi::FunctionReference` created with `Napi::Persistent()` and assigned to a class member to call a JS callback at any point in time, should the code take care of dereferencing it at some point?\r\nhttps://github.com/nodejs/node-addon-api/blob/master/doc/function_reference.md","author":{"url":"https://github.com/marco-ms","@type":"Person","name":"marco-ms"},"datePublished":"2019-09-24T05:43:11.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":8},"url":"https://github.com/550/node-addon-api/issues/550"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c80a5cc8-ebd8-2acf-116e-6a789677de77 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C4E4:10F1DE:132A580:19FD3D0:6A4F148E |
| html-safe-nonce | c8fb641c5e6e6086c3071fc6a4ed43eaf67bb00f8772c8416fe52c1c50059a14 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNEU0OjEwRjFERToxMzJBNTgwOjE5RkQzRDA6NkE0RjE0OEUiLCJ2aXNpdG9yX2lkIjoiMzE4MDkyNTk1NDU1ODk4OTQ1NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 8bac417d84a6d15c46605f54f03cf413959914ce2518bec264beaa72832f3a02 |
| hovercard-subject-tag | issue:497468493 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node-addon-api/550/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7741f304f3cfaa2cd8a454718be9f33551c8973d1ccecdb071e3a3d0f7760f00/nodejs/node-addon-api/issues/550 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7741f304f3cfaa2cd8a454718be9f33551c8973d1ccecdb071e3a3d0f7760f00/nodejs/node-addon-api/issues/550 |
| og:image:alt | I see that SuppressDestructor is used often in the object wrap examples, like: https://github.com/nodejs/node-addon-api/blob/master/doc/object_wrap.md // Call the SuppressDestruct() method on the s... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | marco-ms |
| hostname | github.com |
| expected-hostname | github.com |
| None | b92d11c0aa4a77d54ef4af1078b6a15fb5a70a215b30c4ecf28889d5a8e656d9 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node-addon-api git https://github.com/nodejs/node-addon-api.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 81384578 |
| octolytics-dimension-repository_nwo | nodejs/node-addon-api |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81384578 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node-addon-api |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2b8f23afb982271f1b22258a94aede67a6b77760 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width