TeamAtomECS / AtomECS

Cold atom simulation code
GNU General Public License v3.0
46 stars 12 forks source link

[Bug] Entity "leak" #80

Open minghuaw opened 2 years ago

minghuaw commented 2 years ago

Description of the bug

The oven would "leak" entity if its max_theta is larger than zero.

Cause

An empty entity is created on line 212, which is before the line where whether the atom should be created is checked (line 216). If a non-zero max_theta is found, the omitted atoms will leave empty entities that are never deleted and thus causing entities to "leak".

https://github.com/TeamAtomECS/AtomECS/blob/c4a0fa4333c75481faffc563e84b107ed4055825/src/atom_sources/oven.rs#L212

https://github.com/TeamAtomECS/AtomECS/blob/c4a0fa4333c75481faffc563e84b107ed4055825/src/atom_sources/oven.rs#L216

ElliotB256 commented 2 years ago

Thanks for the report! Do you want to raise a PR or should I?

minghuaw commented 2 years ago

Could you please do the PR on the upstream? I have got some uncommitted modifications downstream. Thanks in advance.