Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Animate] Loader continuous error/unpack with SVG #3492

Closed
itlancer opened this issue Sep 27, 2024 · 2 comments
Closed

[Animate] Loader continuous error/unpack with SVG #3492

itlancer opened this issue Sep 27, 2024 · 2 comments
Labels

Comments

@itlancer
Copy link

Problem Description

If you try to load SVG via Loader from Animate - you will get continuous error/unpack traces.
I'm using patched FDB version from here #399 (comment)
May be it could cause some memory leaks if Loader try to load some unsupported content.
May be issues exists with non-Animate too but you cannot see it.

Tested with latest AIR 51.1.1.5 and Animate 24.0.5 with multiple different Windows devices and different applications.
Same issue in all cases.
There is no such using VSCode or ADL launch.

Related issues:
#2779
#2731
#2523
#2450
#894
#697
#208
#150

Steps to Reproduce

Launch code below using Animate.

Application sample with sources attached.
loader_svg_continuous_bug.zip

package {
	import flash.display.Sprite;
	import flash.net.URLRequest;
	import flash.display.Loader;
	import flash.events.Event;
	import flash.events.IOErrorEvent;
	
	public class LoaderSVGContinuousBug extends Sprite {
		private var loader:Loader = new Loader();
		
		public function LoaderSVGContinuousBug() {
			const urlRequest:URLRequest = new URLRequest("https://airsdk.dev/images/logo.svg");
			loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
			loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, error);
			loader.load(urlRequest);
		}
		
		private function complete(e:Event):void {
			trace("complete");
		}
		
		private function error(e:IOErrorEvent):void {
			trace("error");
		}
	}
}

Actual Result:
In Animate traces you will see:

[SWF] loader_svg_continuous_bug.swf - 1022 bytes
[SWF] /images/logo.svg - 0 bytes
error
[SWF] /images/logo.svg - 0 bytes
[SWF] /images/logo.svg - 0 bytes
[SWF] /images/logo.svg - 0 bytes
[SWF] /images/logo.svg - 0 bytes
[SWF] /images/logo.svg - 0 bytes
[SWF] /images/logo.svg - 0 bytes
...

Expected Result:
In Animate traces you will see:

[SWF] loader_svg_continuous_bug.swf - 1022 bytes
error

Known Workarounds

none

@itlancer itlancer added the Bug label Sep 27, 2024
@ajwfrost
Copy link
Collaborator

FYI, appears to be caused by the fact the debugger constantly asks for the SWF information for a newly loaded SWF (and XML is considered SWF, internally, until it's got enough data to confirm the format type) - it gives up after a couple of minutes I think. See FDB source code from the flex-sdk project...

But we can actually prevent the notification to the debugger by only triggering it on the receipt of a correctly formatted SWF, which seems to stop it.

@itlancer
Copy link
Author

Fixed. Tested with latest AIR 51.1.2.2.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants