From e73cdd7987315a7be5d2cdda83416fb714413c45 Mon Sep 17 00:00:00 2001 From: David Wendt Date: Mon, 28 Sep 2020 19:51:19 -0400 Subject: [PATCH] avm1: Actually unload movies when we get an empty URL in `GetURL2` and the target is a sprite. --- core/src/avm1/activation.rs | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/core/src/avm1/activation.rs b/core/src/avm1/activation.rs index 41420d4ee..231497982 100644 --- a/core/src/avm1/activation.rs +++ b/core/src/avm1/activation.rs @@ -1261,15 +1261,23 @@ impl<'a, 'gc, 'gc_context> Activation<'a, 'gc, 'gc_context> { Cow::Borrowed(&url), NavigationMethod::from_send_vars_method(swf_method), ); - let fetch = self.context.navigator.fetch(&url, opts); - let process = self.context.load_manager.load_movie_into_clip( - self.context.player.clone().unwrap(), - clip_target, - fetch, - url.to_string(), - None, - ); - self.context.navigator.spawn_future(process); + + if url == "" { + //Blank URL on movie loads = unload! + if let Some(mut mc) = clip_target.as_movie_clip() { + mc.replace_with_movie(self.context.gc_context, None) + } + } else { + let fetch = self.context.navigator.fetch(&url, opts); + let process = self.context.load_manager.load_movie_into_clip( + self.context.player.clone().unwrap(), + clip_target, + fetch, + url.to_string(), + None, + ); + self.context.navigator.spawn_future(process); + } } return Ok(FrameControl::Continue);