The problem with destroying the editor from within a
plugin, is that certain code tries to use the editor after the destructive
plugin code, when in fact the editor is no longer there, causing errors and instability.
I have come up with the following code for a
plugin which closes the editor using both async:true
…