Skip to content

Commit 7f45d53

Browse files
committed
Fix ProgressTimer data releasing issue
1 parent 8e06727 commit 7f45d53

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

cocos2d/progress-timer/CCProgressTimerWebGLRenderCmd.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
proto.rendering = function (ctx) {
4848
var node = this._node;
4949
var context = ctx || cc._renderContext;
50-
if (!this._vertexDataCount || !node._sprite)
50+
if (this._vertexDataCount === 0 || !node._sprite)
5151
return;
5252

5353
this._shaderProgram.use();
@@ -177,7 +177,11 @@
177177
proto.releaseData = function(){
178178
if (this._vertexData) {
179179
//release all previous information
180-
cc._renderContext.deleteBuffer(this._vertexWebGLBuffer);
180+
var webglBuffer = this._vertexWebGLBuffer;
181+
setTimeout(function () {
182+
cc._renderContext.deleteBuffer(webglBuffer);
183+
}, 0.1);
184+
this._vertexWebGLBuffer = null;
181185
this._vertexData = null;
182186
this._float32View = null;
183187
this._vertexArrayBuffer = null;

0 commit comments

Comments
 (0)