Fix issue: calling force_close in on_msg may cause undefined behavior.