Title: face_info violates the rule of three in svg_serializer.h · Issue #9380 · IfcOpenShell/IfcOpenShell · GitHub
Open Graph Title: face_info violates the rule of three in svg_serializer.h · Issue #9380 · IfcOpenShell/IfcOpenShell
X Title: face_info violates the rule of three in svg_serializer.h · Issue #9380 · IfcOpenShell/IfcOpenShell
Description: prefiltered_hlr::face_info in src/serializers/svg_serializer.h has a destructor that deletes a raw pointer, but no copy constructor and no copy assignment operator: class face_info { ... BRepTopAdaptor_FClass2d* fclass; face_info(TopoDS_...
Open Graph Description: prefiltered_hlr::face_info in src/serializers/svg_serializer.h has a destructor that deletes a raw pointer, but no copy constructor and no copy assignment operator: class face_info { ... BRepTopAda...
X Description: prefiltered_hlr::face_info in src/serializers/svg_serializer.h has a destructor that deletes a raw pointer, but no copy constructor and no copy assignment operator: class face_info { ... BRepTopAda...
Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/issues/9380
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"face_info violates the rule of three in svg_serializer.h","articleBody":"`prefiltered_hlr::face_info` in `src/serializers/svg_serializer.h` has a destructor that deletes a raw pointer, but no copy constructor and no copy assignment operator:\n\n```cpp\nclass face_info {\n ...\n BRepTopAdaptor_FClass2d* fclass;\n\n face_info(TopoDS_Shape* it, const TopoDS_Face& fa)\n : item(it), face(fa), fclass(nullptr)\n { ... }\n\n ~face_info() {\n delete fclass;\n }\n```\n\nIt is stored by value in `std::multimap\u003cdouble, face_info> large_ortho_faces_`, and `fclass` is allocated lazily inside `contains()`. Because the user-declared destructor suppresses the implicit move constructor, insertion copies, and the implicitly generated copy constructor copies the pointer shallowly.\n\nThis is currently harmless only by accident: `fclass` is still null at the moment of insertion, so the temporary's destructor deletes nothing and the copy in the map starts null as well. Any future code that copies a `face_info` after `contains()` has run would double free.\n\nEither declaring the copy operations deleted, or holding `fclass` in a `std::unique_ptr` and letting the class be move-only, would make the intent explicit and remove the latent trap. I have not opened a PR because the safe choice depends on whether the class is ever meant to be copied, which is a design call rather than a fix.\n\nFound while reading the serializer for #3072. Not a bug anyone can hit today, as far as I can tell — filing it so it is written down rather than rediscovered.\n\n*This analysis was produced with the assistance of an AI coding tool.*\n","author":{"url":"https://github.com/P4A-KLFSBK","@type":"Person","name":"P4A-KLFSBK"},"datePublished":"2026-08-29T16:14:47Z","url":"https://github.com/IfcOpenShell/IfcOpenShell/issues/9380"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:335689b4-7d05-b9ab-1320-bb6d11861edb |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EC60:3B5D6F:338389:47F83C:6B0477CB |
| html-safe-nonce | e6f7c5b25159a7bfc535c83313c6bf3e8de348a8b10a8c372af2908481618ec5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQzYwOjNCNUQ2RjozMzgzODk6NDdGODNDOjZCMDQ3N0NCIiwidmlzaXRvcl9pZCI6IjMyODUwNDczNTYzNzQxNTMxNjMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | d20b1f0e3083bbfbadc479203094defe153b9a4c3fa5839e1c3e850c4c4e29ce |
| hovercard-subject-tag | issue:5287594242 |
| 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/IfcOpenShell/IfcOpenShell/9380/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d67dec20d97fda1924326c2c5f1ad87ebb7740ed0046d91c4874eaa9b0e0cf3c/IfcOpenShell/IfcOpenShell/issues/9380 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d67dec20d97fda1924326c2c5f1ad87ebb7740ed0046d91c4874eaa9b0e0cf3c/IfcOpenShell/IfcOpenShell/issues/9380 |
| og:image:alt | prefiltered_hlr::face_info in src/serializers/svg_serializer.h has a destructor that deletes a raw pointer, but no copy constructor and no copy assignment operator: class face_info { ... BRepTopAda... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | P4A-KLFSBK |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9c099f1b85def81ca352464c276510dfef32deaf3c305404e65b8d270284a58b |
| turbo-cache-control | no-preview |
| go-import | github.com/IfcOpenShell/IfcOpenShell git https://github.com/IfcOpenShell/IfcOpenShell.git |
| octolytics-dimension-user_id | 13692563 |
| octolytics-dimension-user_login | IfcOpenShell |
| octolytics-dimension-repository_id | 40473201 |
| octolytics-dimension-repository_nwo | IfcOpenShell/IfcOpenShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 40473201 |
| octolytics-dimension-repository_network_root_nwo | IfcOpenShell/IfcOpenShell |
| 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 | cf73f57448d52b3a7b619195e182b33d3b3454ca |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width