I’d say its a bug, technically notepad hasn’t completed even though it fires during destruction so the values of self in Completed are garbage once the Destructor has run.
I’d suggest popping a feedback in and code around it by keeping a in scope until you can clean up nicely.
I’d then test that solution in 2019r1 beta because I had a spectacular crash when testing this in there
I would go with Tim’s note and make sure that you’re not leaving the scope that initialized the shell instance before it has completed. I’ve run into this before where I was launching may shells in threads.
Just for the record if anyone’s search hits this later, I found a different bug when testing this <https://xojo.com/issue/55312> (pre-release view only sorry as I found the bug originally in beta) I don’t know if they want the two issues separated or if they’ll both be fixed at the same time so it might need another bug report for the OP.