Title: Allow for saving of props to an object by johnhaley81 · Pull Request #421 · nodegit/nodegit · GitHub
Open Graph Title: Allow for saving of props to an object by johnhaley81 · Pull Request #421 · nodegit/nodegit
X Title: Allow for saving of props to an object by johnhaley81 · Pull Request #421 · nodegit/nodegit
Description: Some properties were being set on the libgit2 C struct but would be destroyed after the function is completed. The problem was that C struct would still assume that the memory it had was valid and would try to use it resulting in random segfaults. Now you can mark an argument as saveArg and then that argument will be persisted to the parent object and disposed of when the parent is deleted. Currently this only works in sync functions since I couldn't find an async method that would need this. If this changes it shouldn't be too hard to implement. Another thing to note is that the if the parent object is marked as !selfFreeing then we're still going to dispose of the persisted objects because if not then they will memory leak all over the place. This might need to be looked into more later. I currently couldn't find a situation where this would happen but the code is pretty complicated at this point and I certainly could have missed something
Open Graph Description: Some properties were being set on the libgit2 C struct but would be destroyed after the function is completed. The problem was that C struct would still assume that the memory it had was valid and ...
X Description: Some properties were being set on the libgit2 C struct but would be destroyed after the function is completed. The problem was that C struct would still assume that the memory it had was valid and ...
Opengraph URL: https://github.com/nodegit/nodegit/pull/421
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:68d68114-0db0-e219-a8d5-a53250f7de11 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | B2B2:29A644:8445CCE:B1E447F:6A5E37EC |
| html-safe-nonce | 7fd8af734af763e3cbb17f9031f987173f7014839cb22f30f1186fac9223a36d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMkIyOjI5QTY0NDo4NDQ1Q0NFOkIxRTQ0N0Y6NkE1RTM3RUMiLCJ2aXNpdG9yX2lkIjoiMTY5NzA0ODM2NjIwNjA0MDA0NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 49cd62a8cd032fcc7668ca48f0d295a7d6dcaa168988740983daf0b142bc8fd7 |
| hovercard-subject-tag | pull_request:29912739 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/nodegit/nodegit/pull/421/files |
| twitter:image | https://avatars.githubusercontent.com/u/867780?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/867780?s=400&v=4 |
| og:image:alt | Some properties were being set on the libgit2 C struct but would be destroyed after the function is completed. The problem was that C struct would still assume that the memory it had was valid and ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | e4b946991e2bd4b122ac7bb3d405be22af15feed82daaafcd1fe0a1231d54061 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/nodegit/nodegit git https://github.com/nodegit/nodegit.git |
| octolytics-dimension-user_id | 657068 |
| octolytics-dimension-user_login | nodegit |
| octolytics-dimension-repository_id | 1383170 |
| octolytics-dimension-repository_nwo | nodegit/nodegit |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1383170 |
| octolytics-dimension-repository_network_root_nwo | nodegit/nodegit |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | a421a3a9fbeebe1ed5ba7c8e5b803b098d65a30e |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width