16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-19 17:59:18 +02:00

reduced memory use, re-enabled debug mode, plugged some of remaining memory leaks

This commit is contained in:
tmj-fstate
2017-10-07 17:20:53 +02:00
parent f6272d37f1
commit 020c71533f
16 changed files with 100 additions and 68 deletions

View File

@@ -2485,9 +2485,15 @@ void TGround::InitTracks()
{ // jak coś pójdzie źle, to robimy z tego normalny tor
// Track->ModelAssign(tmp->Model->GetContainer(NULL)); //wiązanie toru z modelem
// obrotnicy
#ifdef EU07_USE_OLD_GROUNDCODE
Track->RaAssign(
Current, Model ? Model->Model : NULL, FindEvent( Current->asName + ":done" ),
FindEvent( Current->asName + ":joined" ) ); // wiązanie toru z modelem obrotnicy
#else
Track->RaAssign(
Current, Model ? Model->Model : NULL, simulation::Events.FindEvent(Current->asName + ":done"),
simulation::Events.FindEvent(Current->asName + ":joined")); // wiązanie toru z modelem obrotnicy
#endif
// break; //jednak połączę z sąsiednim, jak ma się wysypywać null track
}
if (!Model) // jak nie ma modelu
@@ -2867,12 +2873,21 @@ bool TGround::InitLaunchers()
}
else
EventLauncher->MemCell = nullptr;
#ifdef EU07_USE_OLD_GROUNDCODE
EventLauncher->Event1 = ( EventLauncher->asEvent1Name != "none") ?
FindEvent(EventLauncher->asEvent1Name) :
nullptr;
EventLauncher->Event2 = ( EventLauncher->asEvent2Name != "none") ?
FindEvent(EventLauncher->asEvent2Name) :
nullptr;
#else
EventLauncher->Event1 = ( EventLauncher->asEvent1Name != "none") ?
simulation::Events.FindEvent(EventLauncher->asEvent1Name) :
nullptr;
EventLauncher->Event2 = ( EventLauncher->asEvent2Name != "none") ?
simulation::Events.FindEvent(EventLauncher->asEvent2Name) :
nullptr;
#endif
}
return true;
}
@@ -3526,7 +3541,7 @@ bool TGround::Update(double dt, int iter)
if (bDynamicRemove)
{ // jeśli jest coś do usunięcia z listy, to trzeba na końcu
for (TGroundNode *Current = nRootDynamic; Current; Current = Current->nNext)
if (!Current->DynamicObject->bEnabled)
if ( false == Current->DynamicObject->bEnabled)
{
DynamicRemove(Current->DynamicObject); // usunięcie tego i podłączonych
Current = nRootDynamic; // sprawdzanie listy od początku