You shouldnt be changing the state of the editor, eg stop editing, in an event that it fires. Many internal components also listen to edit events and expect the editor to be still in an edit session when their event is processed, this is whats causing the crash. You'll have to adjust your workflow.