@@ -65,7 +65,7 @@ export default class DecorationManagement {
6565 * @type {Object }
6666 * @access private
6767 */
68- this . decorationDestroyedSubscriptions = { }
68+ this . decorationDestroyedSubscriptions = new Map ( )
6969 }
7070
7171 /**
@@ -409,10 +409,10 @@ export default class DecorationManagement {
409409 } ) )
410410 }
411411
412- this . decorationDestroyedSubscriptions [ decoration . id ] =
412+ this . decorationDestroyedSubscriptions . set ( decoration . id ,
413413 decoration . onDidDestroy ( ( ) => {
414414 this . removeDecoration ( decoration )
415- } )
415+ } ) )
416416
417417 this . emitDecorationChanges ( type , decoration )
418418 this . emitter . emit ( 'did-add-decoration' , {
@@ -529,11 +529,11 @@ export default class DecorationManagement {
529529 subscription = this . decorationUpdatedSubscriptions . get ( decoration . id )
530530 if ( subscription != null ) { subscription . dispose ( ) }
531531
532- subscription = this . decorationDestroyedSubscriptions [ decoration . id ]
532+ subscription = this . decorationDestroyedSubscriptions . get ( decoration . id )
533533 if ( subscription != null ) { subscription . dispose ( ) }
534534
535535 this . decorationUpdatedSubscriptions . delete ( decoration . id )
536- delete this . decorationDestroyedSubscriptions [ decoration . id ]
536+ this . decorationDestroyedSubscriptions . delete ( decoration . id )
537537
538538 const decorations = this . decorationsByMarkerId . get ( marker . id )
539539 if ( ! decorations ) { return }
@@ -619,8 +619,9 @@ export default class DecorationManagement {
619619 decoration . dispose ( )
620620 }
621621
622- for ( const id in this . decorationDestroyedSubscriptions ) {
623- this . decorationDestroyedSubscriptions [ id ] . dispose ( )
622+ const decorationDestroyedSubscriptionsValues = this . decorationDestroyedSubscriptions . values ( )
623+ for ( const decoration of decorationDestroyedSubscriptionsValues ) {
624+ decoration . dispose ( )
624625 }
625626
626627 const decorationsByIdValues = this . decorationsById . values ( )
@@ -633,6 +634,6 @@ export default class DecorationManagement {
633634 this . decorationMarkerChangedSubscriptions . clear ( )
634635 this . decorationMarkerDestroyedSubscriptions . clear ( )
635636 this . decorationUpdatedSubscriptions . clear ( )
636- this . decorationDestroyedSubscriptions = { }
637+ this . decorationDestroyedSubscriptions . clear ( )
637638 }
638639}
0 commit comments