Fix cache-break value to be once-per-compile

This commit is contained in:
Joshua Granick
2016-05-14 11:03:23 -07:00
parent 951addec2a
commit 22549c557b

View File

@@ -1060,11 +1060,14 @@ class AssetCache {
audio = new Map<String, AudioBuffer> ();
font = new Map<String, Dynamic /*Font*/> ();
image = new Map<String, Image> ();
version = Std.int (Math.random () * 1000000);
version = AssetCache.cacheVersion ();
}
private macro static function cacheVersion () {}
public function clear (prefix:String = null):Void {
if (prefix == null) {
@@ -1504,6 +1507,20 @@ class Assets {
}
class AssetCache {
private static macro function cacheVersion () {
var version = Std.int (Math.random () * 1000000);
return Context.makeExpr (version, Context.currentPos ());
}
}
#end
#end
@@ -1518,4 +1535,4 @@ class Assets {
var TEMPLATE = "TEMPLATE";
var TEXT = "TEXT";
}
}