Skip to content

Commit

Permalink
Merge pull request #1694 from loudoweb/dev-fix-library-unload
Browse files Browse the repository at this point in the history
clear cached files on library unload
  • Loading branch information
player-03 committed Jul 5, 2023
2 parents 914009d + 8b27623 commit 8288640
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/lime/utils/AssetLibrary.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down

0 comments on commit 8288640

Please sign in to comment.