Execute some code on exit

Is there a way to execute some code on Slicer exit?

You can detect and intercept application exit request, scene saving, shutdown, etc. at multiple levels. What exactly you would like to do and when?

I would like to cancel a runnig CLI at the application shutdown… I saw there is a signal emitted for startup “startupCompleted()” but none for the shutdown. Does it has to be done directly from Qt?