fix a crash in AsyncSignalHandler destruction
Summary: Update AsyncSignalHandler to check if the events are still registered before trying to unregister them during destruction. Without this check the code crashes if an AsyncSignalHandler is registered, and then the EventBase is destroyed before the AsyncSignalHandler is destroyed. When the EventBase is destroyed the AsyncSignalHandler's event will be automatically unregistered, so `eb_event_del()` should not be called again here, and calling it triggers a crash by attempting to dereference the now-destroyed EventBase. This change makes AsyncSignalHandler behave more like the AsyncTimeout and EventHandler objects, which both support destroying the EventBase before these objects. Differential Revision: D25837541 fbshipit-source-id: a1c44ab442b9078bf84a51be2cced432d247f6cd
Showing
Please register or sign in to comment