kaydent Posted February 6 Share Posted February 6 when I try to dispose an empty container those previously contained sprites would also get removed, even though it's no longer under the container it looks something like this: ``` for (let c1i = 0; c1i < c1.children.length; c1i++) { const c1s = c1.children[c1i]; c1s.setParent(c2); } c1.destroy(); ``` what happen is c1.destroy() removes the previously added sprites inside c1, same thing happens using app.stage.removechild(c1) thanks https://codesandbox.io/p/devbox/v8lzq9 here is an example, I was expecting the sprites to not get removed Quote Link to comment Share on other sites More sharing options...
smith morales Posted February 16 Share Posted February 16 class Client { public: Client(std::list<Client> &clients_) : thread(&Client::run, this), clients(clients_) {} ~Client() { thread.join(); } void run() { // The client does stuff here. clients.remove(*this); } private: std::thread thread; std::list<Client> &clients; }; int main() { std::list<Client> clients; clients.emplace_back(clients); } https://customproductboxes.com/ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.