[Avida-SVN] r2098 - in development/source: analyze main

matt at myxo.css.msu.edu matt at myxo.css.msu.edu
Wed Sep 19 13:11:57 PDT 2007


Author: matt
Date: 2007-09-19 16:11:56 -0400 (Wed, 19 Sep 2007)
New Revision: 2098

Modified:
   development/source/analyze/cAnalyzeGenotype.cc
   development/source/main/cPhenPlastGenotype.cc
Log:
Casted cPhenotype* back to cPlasticPhenotype* in cPhenPlastGenotype destructor.

Modified: development/source/analyze/cAnalyzeGenotype.cc
===================================================================
--- development/source/analyze/cAnalyzeGenotype.cc	2007-09-18 18:59:15 UTC (rev 2097)
+++ development/source/analyze/cAnalyzeGenotype.cc	2007-09-19 20:11:56 UTC (rev 2098)
@@ -388,6 +388,7 @@
 
 void cAnalyzeGenotype::Recalculate(cAvidaContext& ctx, cTestCPU* testcpu, cAnalyzeGenotype* parent_genotype, cCPUTestInfo* test_info, int num_trials)
 {
+  // We are not going to use this testcpu ...
   
   //Allocate our own test info if it wasn't provided
   cCPUTestInfo* temp_test_info = NULL;

Modified: development/source/main/cPhenPlastGenotype.cc
===================================================================
--- development/source/main/cPhenPlastGenotype.cc	2007-09-18 18:59:15 UTC (rev 2097)
+++ development/source/main/cPhenPlastGenotype.cc	2007-09-19 20:11:56 UTC (rev 2098)
@@ -47,7 +47,7 @@
 {
   UniquePhenotypes::iterator it = m_unique.begin();
   while (it != m_unique.end()){
-    delete *it;
+    delete static_cast<cPlasticPhenotype*>(*it);  // Remember to cast back
     ++it;
   }
 }
@@ -71,6 +71,7 @@
       }
     }
   }
+  
   // Update statistics
   UniquePhenotypes::iterator uit = m_unique.begin();
   m_max_fitness     =  -1.0;




More information about the Avida-cvs mailing list