event: Ensure the event loop has been cleaned up in event_teardown

- Add input_teardown/signal_teardown to take care of closing signal/stdin
  handles.
- Call those functions in event_teardown, and ensure there are no active handles
  by entering an infinite loop when there are unclosed handles(think of this as
  an assertion that can't go unoticed on travis).
- Move event_teardown call to the end of mch_exit. That is required because
  event_poll may still be called in that function.
This commit is contained in:
Thiago de Arruda
2014-11-02 16:37:31 -03:00
parent a1dd70b1d0
commit 75a5674cd2
4 changed files with 32 additions and 3 deletions

View File

@@ -522,8 +522,6 @@ void mch_exit(int r)
{
exiting = TRUE;
event_teardown();
{
settmode(TMODE_COOK);
mch_restore_title(3); /* restore xterm title and icon name */
@@ -559,7 +557,7 @@ void mch_exit(int r)
mac_conv_cleanup();
#endif
event_teardown();
#ifdef EXITFREE
free_all_mem();