Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disallow stack-allocated meshes #610

Open
mtao opened this issue Dec 27, 2023 · 0 comments
Open

Disallow stack-allocated meshes #610

mtao opened this issue Dec 27, 2023 · 0 comments

Comments

@mtao
Copy link
Collaborator

mtao commented Dec 27, 2023

Every mesh should be initialized using a shared_ptr, as some datastructures (namely certain Attribute Handles) . This means that we need

  • a static member function called create that constructs a std::shared_ptr<Mesh> (or for derive classes whatever dreived type).
  • all constructors should be made private and friended with make_shared
  • make the this can be checked by checking assert(bool(shared_from_this()));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant