mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 15:52:40 +08:00
Merge pull request #2380 from pandamicro/next
Fix leaks and renderer.drawCalls issue
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -599,7 +599,7 @@ var BaseNode = cc.Class({
|
||||
|
||||
stack.length = 0;
|
||||
stack[0] = this;
|
||||
parent = null;
|
||||
var parent = null;
|
||||
afterChildren = false;
|
||||
while (index) {
|
||||
index--;
|
||||
|
||||
Reference in New Issue
Block a user