Your question actually consists of two parts. Thus, exit from Faro itself is equivalent to System.exit(0)
. Since the system starts the C ++ process and then exits, the same goes for Pharo.
So go ahead: you can think of starting another pharo image from your current one and stop the process itself if you want.
You are actually asking how to get out of some part of the code executed in Pharo. And this is a difficult question, because you also need to answer where is the border between your code and Pharo. I think it depends on your implementation. Perhaps this is enough to close the window or remove an instance of your class from somewhere.
If you want to use a more general approach, you can start execution in a separate pharo process using [ ] fork
, and then stop it by sending it suspend
or terminate
(you can get the active process using Processor activeProcess
). Alternatively, you can make thisContext terminate
.
source share