Browse Source

Merge pull request #9643 from Alex-MSFT/empty_texture_delete

Add safety check to deleting textures in nativeEngine
sebavan 4 năm trước cách đây
mục cha
commit
76bc250847
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  1. 3 1
      src/Engines/nativeEngine.ts

+ 3 - 1
src/Engines/nativeEngine.ts

@@ -1503,7 +1503,9 @@ export class NativeEngine extends Engine {
     }
 
     protected _deleteTexture(texture: Nullable<WebGLTexture>): void {
-        this._native.deleteTexture(texture);
+        if (texture) {
+            this._native.deleteTexture(texture);
+        }
     }
 
     /**