Do not poll events when application is closing