mrjt Messages: 705 Registered: March 2007 Location: London
Contributor
The problem is calling Run. From the manual:
Quote:
Run
Execute modal loop for TopWindow. If TopWindow is not open, it calls Open before starting loop, but it does not close it. Execute
Similar to Run, but closes TopWindow when loop exits.
So you should call Execute instead.
This can be easy to miss as often modal dialogs are declared locally:
void ShowAWindow
{
AWindow wnd;
wnd.Run();
}
in which case the window would be closed when it ran out-of-scope anyway, hiding the problem.