Skip to content

Commit

Permalink
Trying to solve #11 by testing if pointer exist at some places before…
Browse files Browse the repository at this point in the history
… accessing it and commenting out some code that appears to be note very useful. Now we have a warning that the stat does not exist, but no segfault.
  • Loading branch information
Frederic Michaud committed Mar 19, 2018
1 parent 390f3ba commit 920eab5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/lce_misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ LCE("save_stats", "statistics", "", rank), _service(0) {
void LCE_StatServiceNotifier::loadStatServices(StatServices* loader)
{
_service = loader;
_fileHandler.set_statService(loader);
if(_popPtr->get_pStat_db())_fileHandler.set_statService(loader);
_service->set_statArg(_stat_arg);
_service->set_paramArg(_param_arg);
_fileHandler.set_save_choice(_save_choiceTemp);
if(_popPtr->get_pStat_db()) _fileHandler.set_save_choice(_save_choiceTemp);
loader->attach(&_statHandler);
}

Expand Down
4 changes: 2 additions & 2 deletions src/treplicate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -738,10 +738,10 @@ TReplicate::print_info(TMetapop* thePop)
_pSimulation->stats->get_tot_occurrence());
}
else{
message("\n %s (%i statistics) computed at %i generations",
/* message("\n %s (%i statistics) computed at %i generations",
(*curFile)->get_name().c_str(),
_StatServices->get_nb_stats(),
_pSimulation->stats->get_tot_occurrence());
_pSimulation->stats->get_tot_occurrence());*/
}
}
else { // any other file
Expand Down

0 comments on commit 920eab5

Please sign in to comment.