GNOME Bugzilla – Bug 659346
Handle closing a worksheet during execution
Last modified: 2011-09-21 01:48:05 UTC
Right now, a series of Exceptions are raised as Chunks complete exectution and try to update the ShellView. This disconnects those signals, allowing the execution to finish up quietly. Also, the FileList should not change the icon once the file has been closed.
Created attachment 196828 [details] [review] Handle closing a worksheet during execution We don't want to abort the execution, since that's a bit chancy. Instead, disconnect the signal handlers that would be called on the (now gone) ShellView while letting the execution finish. Also, in FileList, don't update the icon of a closed file.
Created attachment 197120 [details] [review] If worksheets are still executing on close, show dialog and wait Thinking about it, it didn't seem right to me to just leave the worksheet running in the background - that's not expected by the user - if it vanishes they will think it's killed. On the other hand, I didn't want to auto-interrupt - it's a little untrustworthy in terms of crashing and more untrustworthy in terms of just stopping the worksheet.. So this patch puts up a dialog with the choice of interrupt or cancel, and waits until the execution is over or the user cancels. Quite a few details here in terms of behavior - e.g., we don't want to wait if the user is closing the only notebook window and we can just exit. I have some patches that are more complex versions of your disconnection patch - it turns out that you don't need them for either memory management (PyGObject manages to hook into Python GC to trace signal connections), or for this, but they might still be a good idea - for one thing, it's a lot easier to debug other memory problems when there aren't a lot of stray signal connections around. I'll attach them to a new bug to sit for a while to figure if they are useful or not. === When a worksheet is still executing when the user tries to close it, we dont't want to just leave it running, eating CPU and spewing errors, so if we aren't exiting immediately, show the user a dialog giving the user the choice to interrupt or cancel.
Attachment 197120 [details] pushed as b6cd24a - If worksheets are still executing on close, show dialog and wait
Disconnection patch filed as bug 659653