DO FORM formName READ EVENTSThen, in the Destroy() of your form, put:
CLEAR EVENTSYou may also want to brute force a shutdown routine, so your main.prg would be at least this:
ON SHUTDOWN QUIT DO FORM formName READ EVENTS ON SHUTDOWNObviously, I don't recommend leaving things like this for a production app, but for a quick and dirty test app, this should be fine.