Skip to content

Commit

Permalink
Don't call Map.clear() in Haxe 3.
Browse files Browse the repository at this point in the history
  • Loading branch information
player-03 committed Jun 7, 2023
1 parent 76c7665 commit 71c1854
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/lime/utils/AssetLibrary.hx
Original file line number Diff line number Diff line change
Expand Up @@ -612,11 +612,19 @@ class AssetLibrary
}

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 71c1854

Please sign in to comment.