Is there a "correct" way to get informed when the interpreter is shutting down? In my case, I need to do some cleanup (in particular, delete the Unix domain socket file) when the interpreter exits.
One hypothetical implementation would involve something like the following function being exposed to plugins:
void register_shutdown_callback( void (*callback)(Type type) );
I could then call this function to register a function that is called whenever the interpreter is about to be stopped. I envision the type argument to inform me as to the type of shutdown (by a INT or HUP signal, a call to )OFF, or a crash, for example).
Would this be possible?
Regards,
Elias