@@ -70,6 +70,9 @@ export default class DecorationManagement {
7070 * @access private
7171 */
7272 this . decorationDestroyedSubscriptions = new Map ( )
73+
74+ // is set to true when a minimapElement is destroyed
75+ this . destroyed = false
7376 }
7477
7578 /**
@@ -322,7 +325,7 @@ export default class DecorationManagement {
322325 * @emits {did-change} when the decoration is created successfully
323326 */
324327 decorateMarker ( marker , decorationParams ) {
325- if ( this . minimap . destroyed || marker == null ) { return }
328+ if ( this . destroyed || this . minimap . destroyed || marker == null ) { return }
326329
327330 const { id } = marker
328331
@@ -435,7 +438,7 @@ export default class DecorationManagement {
435438 * @access private
436439 */
437440 emitDecorationChanges ( type , decoration ) {
438- if ( this . minimap . editorDestroyed ( ) ) { return }
441+ if ( this . destroyed || this . minimap . editorDestroyed ( ) ) { return }
439442
440443 this . invalidateDecorationForScreenRowsCache ( )
441444
@@ -535,7 +538,7 @@ export default class DecorationManagement {
535538 for ( let i = 0 , len = decorations . length ; i < len ; i ++ ) {
536539 const decoration = decorations [ i ]
537540
538- if ( ! this . minimap . editorDestroyed ( ) ) {
541+ if ( ! this . destroyed && ! this . minimap . editorDestroyed ( ) ) {
539542 this . emitDecorationChanges ( decoration . getProperties ( ) . type , decoration )
540543 }
541544 this . emitter . emit ( 'did-remove-decoration' , {
0 commit comments