mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2026-04-27 13:11:42 +00:00
fix more memory leak
This commit is contained in:
parent
0ae13d5acc
commit
41848c97ec
6 changed files with 45 additions and 1 deletions
|
|
@ -990,6 +990,8 @@ class DtsObject extends GameObject {
|
||||||
public override function dispose() {
|
public override function dispose() {
|
||||||
super.dispose();
|
super.dispose();
|
||||||
this.level = null;
|
this.level = null;
|
||||||
|
boundingCollider = null;
|
||||||
|
colliders = null;
|
||||||
this.dtsResource.release();
|
this.dtsResource.release();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1664,4 +1664,11 @@ class Marble extends GameObject {
|
||||||
this.contactEntities = [];
|
this.contactEntities = [];
|
||||||
this._firstTick = true;
|
this._firstTick = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override function dispose() {
|
||||||
|
super.dispose();
|
||||||
|
removeChildren();
|
||||||
|
camera = null;
|
||||||
|
collider = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1571,8 +1571,9 @@ class MarbleWorld extends Scheduler {
|
||||||
gems = null;
|
gems = null;
|
||||||
|
|
||||||
sky.dispose();
|
sky.dispose();
|
||||||
|
sky = null;
|
||||||
instanceManager = null;
|
instanceManager = null;
|
||||||
|
collisionWorld.dispose();
|
||||||
collisionWorld = null;
|
collisionWorld = null;
|
||||||
particleManager = null;
|
particleManager = null;
|
||||||
namedObjects = null;
|
namedObjects = null;
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,15 @@ class CollisionEntity implements IOctreeObject implements IBVHObject {
|
||||||
// this.bvh.build();
|
// this.bvh.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function dispose() {
|
||||||
|
for (s in this.surfaces)
|
||||||
|
s.dispose();
|
||||||
|
go = null;
|
||||||
|
surfaces = null;
|
||||||
|
bvh = null;
|
||||||
|
octree = null;
|
||||||
|
}
|
||||||
|
|
||||||
public function setTransform(transform:Matrix) {
|
public function setTransform(transform:Matrix) {
|
||||||
if (this.transform.equal(transform))
|
if (this.transform.equal(transform))
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -151,4 +151,15 @@ class CollisionSurface implements IOctreeObject implements IBVHObject {
|
||||||
n: _transformedNormals[p1]
|
n: _transformedNormals[p1]
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function dispose() {
|
||||||
|
points = null;
|
||||||
|
normals = null;
|
||||||
|
indices = null;
|
||||||
|
_transformedPoints = null;
|
||||||
|
_transformedNormals = null;
|
||||||
|
edgeData = null;
|
||||||
|
edgeConcavities = null;
|
||||||
|
originalIndices = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -127,4 +127,18 @@ class CollisionWorld {
|
||||||
this.dynamicOctree.update(entity);
|
this.dynamicOctree.update(entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function dispose() {
|
||||||
|
for (e in entities) {
|
||||||
|
e.dispose();
|
||||||
|
}
|
||||||
|
for (e in dynamicEntities) {
|
||||||
|
e.dispose();
|
||||||
|
}
|
||||||
|
octree = null;
|
||||||
|
entities = null;
|
||||||
|
dynamicEntities = null;
|
||||||
|
dynamicOctree = null;
|
||||||
|
dynamicEntitySet = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue