Hi there,
I've got two simple questions.
1. Is "delete this" safe (I'm reading it is!?), assumming method will return (void) immediately after deleting.
2. Is the following code safe:
ThanksCode:void Layer::StrangeDelete() { shared_ptr<Layer> lockme = this_ptr(); // lockme holds shared_ptr to this now _Parent->DeleteChild(); // delete original shared_ptr // lockme goes out of scope and there is no more strong references // "delete this" will take place, but it is no longer in the method scope, so is it safe or not? }