Exit DialogWindow::showModalDialog


#1

When using a modal window with DialogWindow::showModalDialog I tried to exit this programmatically with:

This works great in Windows, but creates a crash on a Mac if the content component is deleted directly after the exiting the modal state.

I found that this works better:

findParentComponentOfClass ((DialogWindow*) 0)->setVisible(false);

Is this a correct way to exit the modal state programmatically?

PieterS


#2

Either one should be ok as long as you’re careful about dangling pointers. More likely that you were lucky to get away with it on windows rather than there being a problem on the mac.