diff options
Diffstat (limited to 'components/script/dom/texttracklist.rs')
-rw-r--r-- | components/script/dom/texttracklist.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/components/script/dom/texttracklist.rs b/components/script/dom/texttracklist.rs index f6f9037902e..0e978972d69 100644 --- a/components/script/dom/texttracklist.rs +++ b/components/script/dom/texttracklist.rs @@ -94,6 +94,7 @@ impl TextTrackList { }), &canceller, ); + track.add_track_list(self); } } @@ -101,6 +102,9 @@ impl TextTrackList { // removed from the TextTrackList. #[allow(dead_code)] pub fn remove(&self, idx: usize) { + if let Some(track) = self.dom_tracks.borrow().get(idx) { + track.remove_track_list(); + } self.dom_tracks.borrow_mut().remove(idx); self.upcast::<EventTarget>() .fire_event(atom!("removetrack")); |