commit c5876968c34d4a9be3ce244072abb014281e49a7 parent ca5a504e4a6bb360afdd8d17fe1226229f3f1bca Author: Martin Kloeckner <mjkloeckner@gmail.com> Date: Thu, 20 Jun 2024 17:26:21 -0300 free the memory occupied by `paradas` Diffstat:
| M | barrio.cpp | | | 9 | +++++++++ |
1 file changed, 9 insertions(+), 0 deletions(-) diff --git a/barrio.cpp b/barrio.cpp @@ -106,5 +106,14 @@ unsigned int Barrio::getCantidadDeParadasPorLinea(int linea) { //CONSIGNA 4 } Barrio::~Barrio() { + Parada *delParada; + + this->paradas->startCursor(); + while(this->paradas->forwardCursor()){ + delParada = this->paradas->getCursorData(); + std::cout << "Eliminando parada `" << delParada->getDireccion() << "`\n"; + delete delParada; + } + delete this->paradas; }
