Merge pull request #1694 from loudoweb/dev-fix-library-unload
clear cached files on library unload
This commit is contained in:
@@ -611,7 +611,22 @@ class AssetLibrary
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function unload():Void {}
|
public function unload():Void
|
||||||
|
{
|
||||||
|
#if haxe4
|
||||||
|
cachedBytes.clear();
|
||||||
|
cachedFonts.clear();
|
||||||
|
cachedImages.clear();
|
||||||
|
cachedAudioBuffers.clear();
|
||||||
|
cachedText.clear();
|
||||||
|
#else
|
||||||
|
cachedBytes = new Map<String, Bytes>();
|
||||||
|
cachedFonts = new Map<String, Font>();
|
||||||
|
cachedImages = new Map<String, Image>();
|
||||||
|
cachedText = new Map<String, String>();
|
||||||
|
classTypes = new Map<String, Class<Dynamic>>();
|
||||||
|
#end
|
||||||
|
}
|
||||||
|
|
||||||
@:noCompletion private function __assetLoaded(id:String):Void
|
@:noCompletion private function __assetLoaded(id:String):Void
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user