Make server quit a bit cleaner by introducing readline_atexit().
- Register readline_atexit() as atexit() function, and not rl_callback_handler_remove()
- Call rl_callback_handler_remove() from readline_atexit()
- Also free last input line (the one where the "quit" command was given)
- Call readline_atexit() from server_quit() already, before exit(). This clear things *before* any other atexit handler. Having readline_atexit() also registered for atexit is just for backup for cases where server_quit() is bypassed.
Make server quit a bit cleaner by introducing readline_atexit().
- Register readline_atexit() as atexit() function, and not rl_callback_handler_remove()
- Call rl_callback_handler_remove() from readline_atexit()
- Also free last input line (the one where the "quit" command was given)
- Call readline_atexit() from server_quit() already, before exit(). This clear things *before* any other atexit handler. Having readline_atexit() also registered for atexit is just for backup for cases where server_quit() is bypassed.