Title: Track Runtime run number by lostmsu · Pull Request #1074 · pythonnet/pythonnet · GitHub
Open Graph Title: Track Runtime run number by lostmsu · Pull Request #1074 · pythonnet/pythonnet
X Title: Track Runtime run number by lostmsu · Pull Request #1074 · pythonnet/pythonnet
Description: Assert, that PyObjects are only disposed in the same run they were created in. What does this implement/fix? Explain your changes. TBH, I failed to find the relevant documentation, but from a quick ducking around my understanding is that Py_Finalize will attempt to destroy all objects, allocated by Python (e.g. instances of C type PyObject). That means, that any .NET objects, that own handles to Python objects (e.g. PyObject or PythonException) should not try to deallocate those handles after Py_Finalize has been called, even if Python runtime is later initialized again for a new run. Right now PyObject.Dispose only checks for Py_IsInitialized, without giving any regard to which runtime run does it belong to versus which run is it now. In this change I add run tracking to Runtime and PyObject, and force-crash PyObject.Dispose instead of calling XDecref when they do not match. We need to determine what should the proper behavior be in that scenario. I believe #958 also suffers from this issue. Does this close any currently open issues? Related to #1073 , #958
Open Graph Description: Assert, that PyObjects are only disposed in the same run they were created in. What does this implement/fix? Explain your changes. TBH, I failed to find the relevant documentation, but from a quick...
X Description: Assert, that PyObjects are only disposed in the same run they were created in. What does this implement/fix? Explain your changes. TBH, I failed to find the relevant documentation, but from a quick...
Opengraph URL: https://github.com/pythonnet/pythonnet/pull/1074
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:6868fdae-c074-6368-41bb-87c66b46afe1 |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | 92BC:3017E0:9F6CA2:D223A5:69716970 |
| html-safe-nonce | 72dc9dced3083a84546db2437b92a7022c383b844cf020adf48cbfb51f49502e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MkJDOjMwMTdFMDo5RjZDQTI6RDIyM0E1OjY5NzE2OTcwIiwidmlzaXRvcl9pZCI6IjMyNTEzMzQ1Njg5MDM1MzQ5NjAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | be7e4ee43afcd6ef09053dd9c1ad9b2a0b2db32a587888f83c2a292f814ea702 |
| hovercard-subject-tag | pull_request:382710587 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,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/pythonnet/pythonnet/pull/1074/checks |
| twitter:image | https://avatars.githubusercontent.com/u/239520?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/239520?s=400&v=4 |
| og:image:alt | Assert, that PyObjects are only disposed in the same run they were created in. What does this implement/fix? Explain your changes. TBH, I failed to find the relevant documentation, but from a quick... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 353479110ec1e87d687013548f216c852055ec907d09d2fb6a180cb5ed9d28e1 |
| turbo-cache-control | no-preview |
| go-import | github.com/pythonnet/pythonnet git https://github.com/pythonnet/pythonnet.git |
| octolytics-dimension-user_id | 6050430 |
| octolytics-dimension-user_login | pythonnet |
| octolytics-dimension-repository_id | 14748123 |
| octolytics-dimension-repository_nwo | pythonnet/pythonnet |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 14748123 |
| octolytics-dimension-repository_network_root_nwo | pythonnet/pythonnet |
| turbo-body-classes | logged-out env-production page-responsive full-width full-width-p-0 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | a4c7e274c03a115b82dcef6c47ce3f7f903e88e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width