Author ned.deily
Recipients ned.deily, serhiy.storchaka, terry.reedy
Date 2014-10-31.08:20:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1414743648.61.0.920824708058.issue22770@psf.upfronthosting.co.za>
In-reply-to
Content
Adding root.update_idletasks() before root.destroy() doesn't help by itself.  As I noted in the Tk issue, to avoid the crash without changing Tk and while still destroying and creating roots/Tcl instances, it is necessary to get the "open application" Apple event from OS X to Tk to trigger while the initial Tcl interpreter instance is still valid.  As far as I can tell, the way to do that is to ensure that the initial Tcl interpreter actually draws something on the screen, not just create a test button object.  The drawing triggers the promotion of the bundle process to a full GUI process and that (I believe) causes the "open application" event to be sent.  As long as that event (which contains the unchecked pointer to the Tcl interpreter instance) is processed by the interpreter that created it, there is no problem.  Once the first root is destroyed (in each process) without having received the "open application" event, when the event does arrive the interp address will be invalid and a segfault can result.
History
Date User Action Args
2014-10-31 08:20:48ned.deilysetrecipients: + ned.deily, terry.reedy, serhiy.storchaka
2014-10-31 08:20:48ned.deilysetmessageid: <1414743648.61.0.920824708058.issue22770@psf.upfronthosting.co.za>
2014-10-31 08:20:48ned.deilylinkissue22770 messages
2014-10-31 08:20:48ned.deilycreate