As a temporary work around, removing the window like this instead:
Code: Select all
guienv->setFocus(theWindow);
theWindow->remove();
I'm not sure if it has something to do with the modal window blinking when you click outside of it, or if its purely related to the window not having focus.
Tested using revision 3767, then I updated to 3876 (current at time of writing) and the error still occurs.