Skip to content

Commit f777daf

Browse files
committed
save
1 parent 2ff6a56 commit f777daf

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/kernels/backend_webgl.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -538,16 +538,16 @@ export class MathBackendWebGL implements KernelBackend {
538538
if (this.texData.has(dataId)) {
539539
const {texture, texShape, usage, complexTensors, isPacked, slice} =
540540
this.texData.get(dataId);
541-
if (texture != null) {
542-
const key = slice && slice.origDataId || dataId;
543-
const refCount = this.dataRefCount.get(key);
544-
if (refCount > 1) {
545-
this.dataRefCount.set(key, refCount - 1);
546-
} else {
547-
this.dataRefCount.delete(key);
541+
const key = slice && slice.origDataId || dataId;
542+
const refCount = this.dataRefCount.get(key);
543+
if (refCount > 1) {
544+
this.dataRefCount.set(key, refCount - 1);
545+
} else {
546+
this.dataRefCount.delete(key);
547+
if (texture != null) {
548548
this.releaseTexture(dataId, texture, texShape, usage, isPacked);
549-
this.texData.delete(dataId);
550549
}
550+
this.texData.delete(dataId);
551551
}
552552
if (complexTensors != null) {
553553
complexTensors.real.dispose();

0 commit comments

Comments
 (0)