Skip to content
Snippets Groups Projects
Commit 76bd2469 authored by Benjamin Cumming's avatar Benjamin Cumming
Browse files

fix invalid memory access

parent 1f13849d
No related branches found
No related tags found
No related merge requests found
...@@ -84,21 +84,15 @@ int main(int argc, char** argv) { ...@@ -84,21 +84,15 @@ int main(int argc, char** argv) {
m.attach_sampler(probe.id, make_trace_sampler(traces.back().get(), sample_dt)); m.attach_sampler(probe.id, make_trace_sampler(traces.back().get(), sample_dt));
} }
m.print_spikes();
// dummy run of the model for one step to ensure that profiling is consistent // dummy run of the model for one step to ensure that profiling is consistent
m.run(options.dt, options.dt); m.run(options.dt, options.dt);
// reset the model // reset the model
m.reset(); m.reset();
std::cout << "\n"; // rest the source spikes
m.print_spikes();
// which requires resetting the sources
for (auto source : local_sources) { for (auto source : local_sources) {
m.add_artificial_spike({source, 0}); m.add_artificial_spike({source, 0});
} }
std::cout << "\n";
m.print_spikes();
// run model // run model
m.run(options.tfinal, options.dt); m.run(options.tfinal, options.dt);
......
...@@ -83,8 +83,12 @@ public: ...@@ -83,8 +83,12 @@ public:
communicator_.reset(); communicator_.reset();
current_events().clear(); for(auto& q : current_events()) {
future_events().clear(); q.clear();
}
for(auto& q : future_events()) {
q.clear();
}
current_spikes().clear(); current_spikes().clear();
previous_spikes().clear(); previous_spikes().clear();
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment