ggandda / simd-cxx

Automatically exported from code.google.com/p/simd-cxx
0 stars 0 forks source link

waitset.cpp does not erase condition from vector on detach #10

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
In waitset.cpp (r39) the detach routine is currently:

DDS::ReturnCode_t
dds::ActiveWaitSet::detach(const dds::ActiveCondition& cond) {
        std::remove(cond_vec_.begin(), cond_vec_.end(), cond);
        return waitset_.detach_condition(cond->get_dds_condition());
}

however std::remove does not actually eliminate elements from the
container, so they will remain present for later operations on the vector.

See http://en.wikibooks.org/wiki/More_C%2B%2B_Idioms/Erase-Remove for the
correct method.

Original issue reported on code.google.com by nick.gl...@lycos.com on 28 Apr 2010 at 12:17

GoogleCodeExporter commented 8 years ago
Hello Nick,

   That's definitively a bug which will be fixed in v0.8. Thanks for spotting it.

Cheers,
    Angelo

Original comment by angelo.corsaro@gmail.com on 15 May 2010 at 11:11

GoogleCodeExporter commented 8 years ago
Fixed as v0.8 2010.06.18

Original comment by angelo.corsaro@gmail.com on 18 Jun 2010 at 1:13