File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -191,6 +191,7 @@ void TCPTransportInterface::clean()
191
191
192
192
{
193
193
std::vector<std::shared_ptr<TCPChannelResource>> channels;
194
+ std::vector<eprosima::fastdds::rtps::Locator> delete_channels;
194
195
195
196
{
196
197
std::unique_lock<std::mutex> scopedLock (sockets_map_mutex_);
@@ -200,10 +201,22 @@ void TCPTransportInterface::clean()
200
201
201
202
for (auto & channel : channel_resources_)
202
203
{
203
- channels.push_back (channel.second );
204
+ if (std::find (channels.begin (), channels.end (), channel.second ) == channels.end ())
205
+ {
206
+ channels.push_back (channel.second );
207
+ }
208
+ else
209
+ {
210
+ delete_channels.push_back (channel.first );
211
+ }
204
212
}
205
213
}
206
214
215
+ for (auto & delete_channel : delete_channels)
216
+ {
217
+ channel_resources_.erase (delete_channel);
218
+ }
219
+
207
220
for (auto & channel : channels)
208
221
{
209
222
if (channel->connection_established ())
You can’t perform that action at this time.
0 commit comments