thanks wysota, so i was thinkin that parent might try to delete a child created on stack which should produce crash..so in nutshell, parent would know when a child is deleted and it wont try to delete it..but still, if i create an object on stack like this
Qt Code:
delete someWidget; // crash here?To copy to clipboard, switch view to plain text mode
in the destructor of parent class(QWidget), they are calling delete on children even when they r created on stack which should produce instantaneous crash..it shouldnt even reach the compiler created code for removing the dialog object or would it? i tried something similar and although it sort off showed a weird crash at delete of child..but somehow it went ahead and executed the code further and then crashed later when the stack tried to delete the dialog object..how was this possible? plus doesnt this show real proof that creating qobjects on stack with a parent should be a big no-no? i mean yeh, the case of hellodan survives this, but shouldnt doing this be discouraged?




Reply With Quote
Bookmarks