Commit 79763b83 authored by Thomas Edwards's avatar Thomas Edwards
Browse files

Previous commit introduced potential memory leak. Cleaned up with new version.

parent 81fe3e5f
...@@ -501,8 +501,16 @@ int Filter_Obs::lowpass_PLASMON_1Hz(buffer_obs* buffer_in, ...@@ -501,8 +501,16 @@ int Filter_Obs::lowpass_PLASMON_1Hz(buffer_obs* buffer_in,
if (tofilter1.size() > que_limit) { if (tofilter1.size() > que_limit) {
std::cerr << "[!!!] WARNING! Que limit has been reached! Restarting filter!" << std::endl; std::cerr << "[!!!] WARNING! Que limit has been reached! Restarting filter!" << std::endl;
// remove all data in ques // remove all data in ques
for (int ix = 0; ix < tofilter1.size(); ix++) {
delete(tofilter1[ix]);
}
tofilter1.clear(); tofilter1.clear();
for (int ix = 0; ix < tofilter2.size(); ix++) {
delete(tofilter2[ix]);
}
tofilter2.clear(); tofilter2.clear();
// break from loop to trigger a restart
break; break;
} }
......
Markdown is supported
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