CB100

Notas, resueltos y tps de la materia Algoritmos y Estructuras de Datos
Index Commits Files Refs README
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:
Mbarrio.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;
 }