Fix free(RID) abuse by various classes

This commit is contained in:
Cory Petkovsek 2022-08-11 02:22:37 +08:00
parent 850c5ccccf
commit f7f112ab1f
3 changed files with 12 additions and 4 deletions

View File

@ -419,5 +419,7 @@ Particles2D::Particles2D() {
}
Particles2D::~Particles2D() {
if (particles.is_valid()) {
VS::get_singleton()->free(particles);
}
}

View File

@ -179,8 +179,10 @@ GIProbeData::GIProbeData() {
}
GIProbeData::~GIProbeData() {
if (probe.is_valid()) {
VS::get_singleton()->free(probe);
}
}
//////////////////////
//////////////////////
@ -527,5 +529,7 @@ GIProbe::GIProbe() {
}
GIProbe::~GIProbe() {
if (gi_probe.is_valid()) {
VS::get_singleton()->free(gi_probe);
}
}

View File

@ -416,5 +416,7 @@ Particles::Particles() {
}
Particles::~Particles() {
if (particles.is_valid()) {
VS::get_singleton()->free(particles);
}
}