src/sn-evolution.c: Free the population before exiting.
authorFlorian Forster <octo@huhu.verplant.org>
Sat, 2 Feb 2008 00:01:56 +0000 (01:01 +0100)
committerFlorian Forster <octo@huhu.verplant.org>
Sat, 2 Feb 2008 00:01:56 +0000 (01:01 +0100)
src/sn-evolution.c

index f43906e..d3184d9 100644 (file)
@@ -245,6 +245,19 @@ int main (int argc, char **argv)
     sn_network_show (population[best_index].network);
   }
 
+  {
+    int i;
+
+    for (i = 0; i < population_size; i++)
+    {
+      sn_network_destroy (population[i].network);
+      population[i].network = NULL;
+    }
+
+    free (population);
+    population = 0;
+  }
+
   return (0);
 } /* int main */