Merge pull request #2380 from pandamicro/next

Fix leaks and renderer.drawCalls issue
This commit is contained in:
pandamicro
2018-02-28 18:25:43 +08:00
committed by GitHub
4 changed files with 18 additions and 5 deletions
+6 -1
View File
@@ -412,7 +412,12 @@ cc.Director.prototype = {
cc.renderer.clear();
this._scene = null;
if (!CC_EDITOR) {
if (cc.isValid(this._scene)) {
this._scene.destroy();
}
this._scene = null;
}
this.stopAnimation();
@@ -124,8 +124,16 @@ let _lineSpacing = 0;
let _string = '';
let _fontSize = 0;
let _originFontSize = 0;
let _overflow = 0;
let _contentSize = cc.size();
let _hAlign = 0;
let _vAlign = 0;
let _spacingX = 0;
let _lineHeight = 0;
let _overflow = 0;
let _isWrapText = false;
let _labelWidth = 0;
let _labelHeight = 0;
let _maxLineWidth = 0;
module.exports = {
createData (comp) {
+2 -2
View File
@@ -151,13 +151,13 @@ module.exports = {
},
render (ecScene) {
this.drawCalls = 0;
this.device._stats.drawcalls = 0;
if (ecScene) {
// walk entity component scene to generate models
this._walker.visit(ecScene);
this.drawCalls = this.device._stats.drawcalls;
// Render models in renderer scene
this._forward.render(this.scene);
this.drawCalls = this.device._stats.drawcalls;
}
},
+1 -1
View File
@@ -599,7 +599,7 @@ var BaseNode = cc.Class({
stack.length = 0;
stack[0] = this;
parent = null;
var parent = null;
afterChildren = false;
while (index) {
index--;