Skip to content

Commit

Permalink
[Reviewed] [3D particle emitter] Fix a memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
D8H committed Jan 18, 2024
1 parent 8f29e83 commit 8795e06
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions extensions/reviewed/ParticleEmitter3D.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"name": "ParticleEmitter3D",
"previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/f2e5a34bf465f781866677762d385d6c8e9e8d203383f2df9a3b7e0fad6a2cb5_fire.svg",
"shortDescription": "Display a large number of particles to create visual effects.",
"version": "1.1.2",
"version": "1.1.3",
"description": [
"Particle emitters can be used to display:",
"- Fire",
Expand Down Expand Up @@ -5325,15 +5325,12 @@
"object.__particleEmitterAdapter = new ParticleEmitterAdapter(particleSystem, colorOverLife, sizeOverLife, applyForce);",
"object.__particleSystem = particleSystem;",
"",
"// This is a hack that may break in future releases.",
"// Replace the group that would hold children objects by the emmiter.",
"const layer = gameScene.getLayer(object.getLayer());",
"layer.getRenderer().remove3DRendererObject(object.getRenderer()._threeGroup);",
"object.getRenderer()._threeGroup = particleSystem.emitter;",
"layer.getRenderer().add3DRendererObject(particleSystem.emitter);",
"const ParticleEmitter3D = Object.getPrototypeOf(object);",
"if (!ParticleEmitter3D.__isDefined) {",
" ParticleEmitter3D.__isDefined = true;",
" ParticleEmitter3D.get3DRendererObject = function() {",
" return this.__particleSystem.emitter;",
" };",
"}",
"",
"// See doStepPostEvents",
"gameScene.__particleEmmiter3DExtension = gameScene.__particleEmmiter3DExtension || {};",
Expand Down

0 comments on commit 8795e06

Please sign in to comment.