Skip to content

removing a component inside a member function of this component #981

Answered by skypjack
Nathan-M-code asked this question in Q&A
Discussion options

You must be logged in to vote

If the component is assigned to m_entity, then yes, it's destroyed.
Is it safe? According to C++, yes. It's not different from doing a delete this, which is perfectly fine in C++ if you know what you're doing. 🤷‍♂️
On the other hand, if the question is am I going to hurt myself? Well, I don't know 🙂 since I don't have access to the full codebase nor the time to inspect it to give you a proper answer.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Nathan-M-code
Comment options

Answer selected by Nathan-M-code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
discussion it sounds interesting, let's discuss it
2 participants