]> mj.ucw.cz Git - libucw.git/commit
Main: Added main_teardown() and main_destroy()
authorMartin Mares <mj@ucw.cz>
Sat, 26 Feb 2011 11:11:16 +0000 (12:11 +0100)
committerMartin Mares <mj@ucw.cz>
Sat, 26 Feb 2011 11:11:16 +0000 (12:11 +0100)
commit6abfdbaa3b7ca7f418c459fd7613e4a95d78800e
tree56e63ec0e16ab45b8c788ef1b8933ba895c395d4
parentb62ef58dead9fbf4005f5b2e278392375d8eb64b
Main: Added main_teardown() and main_destroy()

There are now two possibilities how to get rid of a main loop
context. Either you call main_delete(), which is gentle and fails
whenever there are any active files/hooks/etc. Or you call main_destroy(),
which forcibly removes all such objects; it also closes all files.

main_teardown() just calls main_destroy() on the current context,
just as main_cleanup() calls main_delete().

Also, file_close_all() is no longer available -- the only known use
cases are after fork(), but closing files is no longer sufficient
there. All calls to file_close_all() should be therefore replaced
by main_teardown().
ucw/main-test.c
ucw/mainloop.c
ucw/mainloop.h