I think I may have found this but I’m some what confused… I was able to make the error happen on my machine.
I have a Window that shows up the very first time the user starts the app where they enter their name and email. That then e-mails me from an SMTPSocket. I don’t allow the window to close until that SMTPSocket’s work is complete. But it appears something is still possibly happening with this socket? That’s the only thing I can think of…But I don’t use an AddHandler directive on it…
OK. So I figured out what was causing this but I’m not sure I completely understand why. Something has changed with the SMTPSocket in the framework. Thinking I should file a bug report.
So I have the Socket sending an e-mail. In the MailSent Event for the socket, I close the Window. The window gets destroyed but the socket does not. The socket is still existing. I can see it in the debugger when the program breaks for the exception. The exception is happening in the Xojo framework. There is a WeakRef for the ownerWindow of the socket - it’s NIL. But the socket is still there.
I’ve just had a very similar problem. Mine was that I was closing the window in the changed event of a listbox and that caused a framework assertion which crashed the application. The workaround is to use xojo.core.timer.calllater(0, addressof ).
[quote=268431:@Eli Ott]Does the SMTPSocket (subclass) own the window being closed in the MailSent event and/or is the SMTPSocket a property of this window?
Do you have a circular reference ownerWindow <-> SMTPSocket?[/quote]
The SMTP socket is not subclassed. It’s just a standard SMTPSocket dropped onto the window. So no, there’s no circular references unless the Xojo framework is creating them.
[quote=268404:@Wayne Golding]I’ve just had a very similar problem. Mine was that I was closing the window in the changed event of a listbox and that caused a framework assertion which crashed the application. The workaround is to use xojo.core.timer.calllater(0, addressof ).
See my example in feedback. Stephane quickly closed it as not reproducible but I beg to differ. I know he didn’t even try it out becuase the app sends me an email![/quote]
I suspect he changed the code to email to himself.