Quantcast
Channel: Bugs Latest Topics
Viewing all articles
Browse latest Browse all 760

Dispose a Prim2D element will crash the BABYLON

$
0
0

By removing _transparentPrimitiveInfo in the dispose function, I solved this problem.

 

RenderablePrim2D.prototype.dispose = function () {
	if (!_super.prototype.dispose.call(this)) {
	    return false;
	}
	if (this._modelRenderInstanceID) {
	    this._modelRenderCache.removeInstanceData(this._modelRenderInstanceID);
	    this._modelRenderInstanceID = null;
	}
	if (this._modelRenderCache) {
	    this._modelRenderCache.dispose();
	    this._modelRenderCache = null;
	}

	if (this._transparentPrimitiveInfo) {
	    this.renderGroup._renderableData.removeTransparentPrimitiveInfo(this._transparentPrimitiveInfo);
	    this._transparentPrimitiveInfo = null;
	}
                        
	if (this._instanceDataParts) {
	    this._instanceDataParts.forEach(function (p) {
	        p.freeElements();
	    });
	    this._instanceDataParts = null;
	}
	return true;
};

 

QQ图片20160607161758.png

QQ图片20160607161624.png


Viewing all articles
Browse latest Browse all 760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>