Handle iterator pointing to end

This commit is contained in:
Isaac Connor 2021-01-30 20:34:09 -05:00
parent 9ef9fe81fa
commit 5fc52ae6df
1 changed files with 3 additions and 0 deletions

View File

@ -140,6 +140,9 @@ bool zm_packetqueue::queuePacket(ZMPacket* add_packet) {
++iterators_it
) {
packetqueue_iterator *iterator_it = *iterators_it;
if ( *iterator_it == pktQueue.end() ) {
continue;
}
// Have to check each iterator and make sure it doesn't point to the packet we are about to delete
if ( *(*iterator_it) == zm_packet ) {
Debug(4, "Found IT at beginning of queue. Threads not keeping up");