17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-10 18:23:16 +01:00

fix: a deleted model is no longer the picked node, an orthophoto tile isn't swept as a grey stub, the ED brake arrays freed

Deleting a model in the editor left the renderer holding it as the picked node, the next pick used freed memory: the renderer forgets it now (Forget_Node). A texture filled straight from memory (internalsrc:) can't be read again, released by the garbage sweep it came back grey; it stays now, and the units bound with the old name are rebound. The arrays of the ED brake force sharing are vectors, they leaked once per update. The scene hierarchy and the editor menu items go through the translation. Python caches ignored.
This commit is contained in:
maj00r
2026-11-03 21:45:58 +01:00
parent 0d69059448
commit e230d7b902
10 changed files with 47 additions and 17 deletions

View File

@@ -3381,15 +3381,12 @@ bool TDynamicObject::Update(double dt, double dt1)
&& MoverParameters->eimc[eimc_p_abed] < 0.001)
FzadED = 0; //pętla bezpieczeństwa - bez ED
auto const FzadPN = Fzad - FrED * MoverParameters->MED_FrED_factor;
//np = 0;
// BUG: likely memory leak, allocation per inner loop, deleted only once outside
// TODO: sort this shit out
bool* PrzekrF = new bool[np];
std::vector<bool> PrzekrF( np );
float nPrzekrF = 0;
bool test = true;
float* FzED = new float[np];
float* FzEP = new float[np];
float* FmaxEP = new float[np];
std::vector<float> FzED( np );
std::vector<float> FzEP( np );
std::vector<float> FmaxEP( np );
// 3. ustaw pojazdom sile hamowania ED
// - proporcjonalnie do mozliwosci
@@ -3548,11 +3545,6 @@ bool TDynamicObject::Update(double dt, double dt1)
}
delete[] PrzekrF;
delete[] FzED;
delete[] FzEP;
delete[] FmaxEP;
MED_oldFED = FzadED;
}