Merge pull request #4921 from keymanapp/fix/windows/cherry-pick/4848-access-violation-closing-text-editor fix(windows): access violation closing text editor 🍒