IDE hangs when closing a window in the debugged app

Hello,

In one of my projects, I have some code in the PageReceived event of a HTTPSocket object (part of a rather complex initialization procedure). This code includes these relevant lines:
if app.WinToClose<>nil then
app.WinToClose.Close
app.WinToClose=nil
end if

Debugging using the Remote Debugger (from the Mac IDE to Linux Mint), I’ve discovered something strange that I can’t reproduce in a simple project. When app.WinToClose.Close is called, the window’s CancelClose event is called just fine, but then the app hangs. System monitor shows it uses constantly around 48% of CPU at that point; I can interact with the window’s buttons (thought it’s a non-moveable modal, so there are just two buttons). The IDE just waits; I can’t stop the debugged app either (other than killing it on the Linux side).

It would be great to be able to do like in Mac OS X, where one can sample the process (thus seeing where the problem belongs), although I’m not sure it would help in this case.

Any idea on what I could do?

Have you tried Pausing the debugger to see if it’s stuck in a tight loop?

Yes, and it is not. Pausing the debugger does nothing.
Thanks for your answer.

I’m now considering it happens whenever the main window is shown (even the EnableMenuItems call makes the app hanging). I’ve removed all the controls and events the window had but the problem is still there; weird.

Ok, I’ve found the problem. I had a menu with a lot of deep sub-menu items (it was a menu “for fun” that I somehow had to remove for the final release; I added it early in the app, so I even forgot about it). Now, I know Linux doesn’t like 10 levels of submenus…