No, it's not. Lifespan of a modal dialog is short - most probably it is born and dies within the same function (method) call. So there is no risk the child will live longer than its parent because it is created on the stack within one of its parent's (sub)methods.
Yes, it would crash. But the parent won't try to delete it because it opened the dialog for a reason and it wants to react on the choice/action performed by the user within the modal dialog.one would think it should be...when parent will try to delete it, it should be crashing time..or am i getting smth really wrong about model dialog??
Yes, you can. But then the dialog will not really be modal..or maybe u can create a model dialog on stack and not give it a parent..
No, it's fine :-) The parent lives longer than the child so the child will detach itself from the parent when it goes out of scope and is destroyed thus the parent will not try to delete it when it (the parent this time) goes out of scope.in these examples, 'this' is parent, so be a dialog model or not, dialog creation on stack should be wrong.






Reply With Quote
Bookmarks