Has anyone else experienced inconsistent screen freezes when running their forms application?

We are about to go live but our testers are reporting that some of the forms just lock up when they are trying to exit using the X window button.

The forms have a WHEN-WINDOW-CLOSED trigger with the following code:

-- check if window being closed is the main window
-- if so, then exit the form
if :system.event_window = 'WN_MAIN' then
end if;

Unfortunately, because the problem is not happening all the time it is very hard to solve. A few observations have been made:
- the problem happens when the application/forms have been on screen for a long time (usually 3+ hours).
- there are usually multiple forms open, but not always.

If anyone else has experienced (and hopefully solved) this problem, please get in touch.