Skip to content

Commit

Permalink
Popover - TrackViewport - discard items properly
Browse files Browse the repository at this point in the history
  • Loading branch information
turner committed Dec 7, 2023
1 parent cc71edb commit a2aba67
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
16 changes: 16 additions & 0 deletions js/trackViewport.js
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,22 @@ class TrackViewport extends Viewport {
return content
}

dispose() {

if (this.popover) {
this.popover.dispose()
}

if (this.popoverList) {
for (let i = 0; i < this.popoverList.length; i++ ) {
this.popoverList[ i ].dispose()
}

this.popoverList = undefined
}

super.dispose()
}

}

Expand Down
4 changes: 0 additions & 4 deletions js/viewport.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,6 @@ class Viewport {
*/
dispose() {

if (this.popover) {
this.popover.dispose()
}

this.$viewport.get(0).remove()

// Null out all properties -- this should not be neccessary, but just in case there is a
Expand Down

0 comments on commit a2aba67

Please sign in to comment.