[Avida-SVN] r3042 - development/source/main

beckma24 at myxo.css.msu.edu beckma24 at myxo.css.msu.edu
Mon Dec 15 06:59:37 PST 2008


Author: beckma24
Date: 2008-12-15 09:59:37 -0500 (Mon, 15 Dec 2008)
New Revision: 3042

Modified:
   development/source/main/cPopulation.cc
Log:
Bug Fix: cPopulation::ProcessStepSpeculative was using a possibly deleted organism

Modified: development/source/main/cPopulation.cc
===================================================================
--- development/source/main/cPopulation.cc	2008-12-15 05:34:54 UTC (rev 3041)
+++ development/source/main/cPopulation.cc	2008-12-15 14:59:37 UTC (rev 3042)
@@ -3588,6 +3588,7 @@
     }
   }
   
+	double merit = cur_org->GetPhenotype().GetMerit().GetDouble();
   if (cur_org->GetPhenotype().GetToDelete() == true) {
 		delete cur_org;
 		cur_org = NULL;
@@ -3602,7 +3603,7 @@
     for(int i = 0; i < GetNumDemes(); i++) GetDeme(i).Update(step_size);
     
     cDeme & deme = GetDeme(GetCell(cell_id).GetDemeID());
-    deme.IncTimeUsed(cur_org->GetPhenotype().GetMerit().GetDouble());
+    deme.IncTimeUsed(merit);
     CheckImplicitDemeRepro(deme);
   }
   




More information about the Avida-cvs mailing list