Rename to "on_end_main_loop" or something like that. Current name is too generic to indicate when it will be called.