core: Stop stream sounds when a clip is removed

This commit is contained in:
Mike Welsh 2020-02-21 17:53:34 -08:00
parent 6b503ac053
commit f80c188048
1 changed files with 5 additions and 5 deletions

View File

@ -380,11 +380,11 @@ impl<'gc> TDisplayObject<'gc> for MovieClip<'gc> {
}
fn unload(&mut self, context: &mut UpdateContext<'_, 'gc, '_>) {
self.0.write(context.gc_context).run_clip_action(
(*self).into(),
context,
ClipEvent::Unload,
);
{
let mut mc = self.0.write(context.gc_context);
mc.stop_audio_stream(context);
mc.run_clip_action((*self).into(), context, ClipEvent::Unload);
}
self.set_removed(context.gc_context, true);
}