Adobe-Runtime-Support
Adobe-Runtime-Support copied to clipboard
[Animate] `Loader` continuous error/unpack with SVG
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 https://github.com/airsdk/Adobe-Runtime-Support/issues/399#issuecomment-1376381236
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: https://github.com/airsdk/Adobe-Runtime-Support/discussions/2779 https://github.com/airsdk/Adobe-Runtime-Support/issues/2731 https://github.com/airsdk/Adobe-Runtime-Support/issues/2523 https://github.com/airsdk/Adobe-Runtime-Support/issues/2450 https://github.com/airsdk/Adobe-Runtime-Support/issues/894 https://github.com/airsdk/Adobe-Runtime-Support/discussions/697 https://github.com/airsdk/Adobe-Runtime-Support/issues/208 https://github.com/airsdk/Adobe-Runtime-Support/issues/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
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.
Fixed. Tested with latest AIR 51.1.2.2. Thanks!