Skip to content

Commit

Permalink
Merge pull request #14 from Live2D/feature/fix_texture_release
Browse files Browse the repository at this point in the history
Fix texture release.
  • Loading branch information
itoh-at-live2d-com authored Oct 26, 2018
2 parents 5cb5380 + f6d9387 commit cbc4e22
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Framework/rendering/cubismrenderer_WebGL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,8 @@ export namespace Live2DCubismFramework
this._channelColors = null;

// テクスチャ解放
this.gl.deleteTexture(this._channelColors);
this.gl.deleteTexture(this._colorBuffer);
this._colorBuffer = null;
}

/**
Expand Down Expand Up @@ -1478,8 +1479,14 @@ export namespace Live2DCubismFramework
this._bufferData.uv = null;
this.gl.deleteBuffer(this._bufferData.index);
this._bufferData.index = null;

this._bufferData = null;

for (const ite: csmmap.iterator<number, WebGLTexture> = this._textures.begin(); ite.notEqual(this._textures.end()); ite.preIncrement())
{
this.gl.deleteTexture(ite.ptr().second);
}
this._textures.clear();
this._textures = null;
}

/**
Expand Down

0 comments on commit cbc4e22

Please sign in to comment.