A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.
TypeScript 2d-game-engine3d3d-game-engineandroidcppecsgame-editorgame-enginegamedeviostypescriptwebassemblywebglwebgpuwechat-minigame
fix: texture reference counting leak with flip parameter
esengine6902c082c354
diff --git a/sdk/src/asset/AssetServer.ts b/sdk/src/asset/AssetServer.tsindex eb69ca8f1..8ad8aa64b 100644--- a/sdk/src/asset/AssetServer.ts+++ b/sdk/src/asset/AssetServer.ts@@ -200,10 +200,13 @@ export class AssetServer {const rm = this.module_.getResourceManager();for (const flip of [true, false]) {const key = this.textureCacheKey(source, flip);+ const refCount = this.textureRefCounts_.get(key);+ if (refCount === undefined) continue;+const info = this.textureCache_.get(key);if (!info) continue;- const count = (this.textureRefCounts_.get(key) ?? 1) - 1;+ const count = refCount - 1;if (count <= 0) {rm.releaseTexture(info.handle);this.textureCache_.delete(key);