فهرست منبع

minor optimization to reduce memory

ncannasse 10 سال پیش
والد
کامیت
c2601184f3
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      hxd/fs/EmbedFileSystem.hx

+ 1 - 1
hxd/fs/EmbedFileSystem.hx

@@ -115,13 +115,13 @@ private class EmbedEntry extends FileEntry {
 			throw Std.string(e) + " while loading " + relPath;
 			throw Std.string(e) + " while loading " + relPath;
 		});
 		});
 		loader.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, function(_) {
 		loader.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, function(_) {
-			close();
 			var content : flash.display.Bitmap = cast loader.content;
 			var content : flash.display.Bitmap = cast loader.content;
 			onLoaded(new LoadedBitmap(content.bitmapData));
 			onLoaded(new LoadedBitmap(content.bitmapData));
 			loader.unload();
 			loader.unload();
 		});
 		});
 		open();
 		open();
 		loader.loadBytes(bytes);
 		loader.loadBytes(bytes);
+		close(); // flash will copy bytes content in loadBytes() !
 		#elseif js
 		#elseif js
 		// directly get the base64 encoded data from resources
 		// directly get the base64 encoded data from resources
 		var rawData = null;
 		var rawData = null;