Title: Singletons in Registry.cc destroyed by Registry::~Registry · Issue #327 · stepcode/stepcode · GitHub
Open Graph Title: Singletons in Registry.cc destroyed by Registry::~Registry · Issue #327 · stepcode/stepcode
X Title: Singletons in Registry.cc destroyed by Registry::~Registry · Issue #327 · stepcode/stepcode
Description: The TypeDescriptors for built in types in Registry.cc: const TypeDescriptor * t_sdaiINTEGER = NULL; const TypeDescriptor * t_sdaiREAL = NULL; const TypeDescriptor * t_sdaiNUMBER = NULL; const TypeDescriptor * t_sdaiSTRING = NULL; const T...
Open Graph Description: The TypeDescriptors for built in types in Registry.cc: const TypeDescriptor * t_sdaiINTEGER = NULL; const TypeDescriptor * t_sdaiREAL = NULL; const TypeDescriptor * t_sdaiNUMBER = NULL; const TypeD...
X Description: The TypeDescriptors for built in types in Registry.cc: const TypeDescriptor * t_sdaiINTEGER = NULL; const TypeDescriptor * t_sdaiREAL = NULL; const TypeDescriptor * t_sdaiNUMBER = NULL; const TypeD...
Opengraph URL: https://github.com/stepcode/stepcode/issues/327
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Singletons in Registry.cc destroyed by Registry::~Registry","articleBody":"The TypeDescriptors for built in types in Registry.cc:\n\nconst TypeDescriptor \\* t_sdaiINTEGER = NULL;\nconst TypeDescriptor \\* t_sdaiREAL = NULL;\nconst TypeDescriptor \\* t_sdaiNUMBER = NULL;\nconst TypeDescriptor \\* t_sdaiSTRING = NULL;\nconst TypeDescriptor \\* t_sdaiBINARY = NULL;\nconst TypeDescriptor \\* t_sdaiBOOLEAN = NULL;\nconst TypeDescriptor \\* t_sdaiLOGICAL = NULL;\n\nAre initialised as singletons by the Registry::Registry constructor.\n\nWhen multiple Registry objects are created (e.g. STEPfile creates one for processing headers), the first Registry::~Registry destructor called will nuke these type definitions, despite other Registry objects still existing and needing them.\n\nOne potential (and very simple) fix is to just leave them initialised, and drop the following code from Registry::~Registry:\n\n```\nif( t_sdaiINTEGER ) {\n delete t_sdaiINTEGER;\n t_sdaiINTEGER = NULL;\n}\nif( t_sdaiREAL ) {\n delete t_sdaiREAL;\n t_sdaiREAL = NULL;\n}\nif( t_sdaiSTRING ) {\n delete t_sdaiSTRING;\n t_sdaiSTRING = NULL;\n}\nif( t_sdaiBINARY ) {\n delete t_sdaiBINARY;\n t_sdaiBINARY = NULL;\n}\nif( t_sdaiBOOLEAN ) {\n delete t_sdaiBOOLEAN;\n t_sdaiBOOLEAN = NULL;\n}\nif( t_sdaiLOGICAL ) {\n delete t_sdaiLOGICAL;\n t_sdaiLOGICAL = NULL;\n}\nif( t_sdaiNUMBER ) {\n delete t_sdaiNUMBER;\n t_sdaiNUMBER = NULL;\n}\n```\n\nI ran into this when running some test code under valgrind.\n","author":{"url":"https://github.com/pcjc2","@type":"Person","name":"pcjc2"},"datePublished":"2015-04-04T23:16:53.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/327/stepcode/issues/327"}
| 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:7ab83735-c192-ad7c-1cb2-ebcc74b5583b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B2DE:242157:3B958BC:4DF245A:6974C88A |
| html-safe-nonce | 89f43865366e2aaa15175c51baed92d2fefe72f822bf400626d1a8094d5f378b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMkRFOjI0MjE1NzozQjk1OEJDOjRERjI0NUE6Njk3NEM4OEEiLCJ2aXNpdG9yX2lkIjoiMzA2NDUwMjc5NTc0MzA1Mzk2MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 173b83e3996a8e12ada3f0c2620d4b271102d19348305bc382a079d0a1e8c1e0 |
| hovercard-subject-tag | issue:66377837 |
| 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/stepcode/stepcode/327/issue_layout |
| twitter:image | https://opengraph.githubassets.com/83409d08c41f02c83f108712026c3ce2baae454af5cefe666bc5dae18cb2befe/stepcode/stepcode/issues/327 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/83409d08c41f02c83f108712026c3ce2baae454af5cefe666bc5dae18cb2befe/stepcode/stepcode/issues/327 |
| og:image:alt | The TypeDescriptors for built in types in Registry.cc: const TypeDescriptor * t_sdaiINTEGER = NULL; const TypeDescriptor * t_sdaiREAL = NULL; const TypeDescriptor * t_sdaiNUMBER = NULL; const TypeD... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | pcjc2 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4a4bf5f4e28041a9d2e5c107d7d20b78b4294ba261cab243b28167c16a623a1f |
| turbo-cache-control | no-preview |
| go-import | github.com/stepcode/stepcode git https://github.com/stepcode/stepcode.git |
| octolytics-dimension-user_id | 1761770 |
| octolytics-dimension-user_login | stepcode |
| octolytics-dimension-repository_id | 1975387 |
| octolytics-dimension-repository_nwo | stepcode/stepcode |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1975387 |
| octolytics-dimension-repository_network_root_nwo | stepcode/stepcode |
| 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 | 488b30e96dfd057fbbe44c6665ccbc030b729dde |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width