call _ae_destroy_context() and _ae_invalidate_state() from the proper places