Replace `check_closed_event` macro with a function