Skip to content

Commit 1ae223b

Browse files
Don't incremenet event it until we are done with the packet
1 parent b613d56 commit 1ae223b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/zm_event.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,6 @@ void Event::Run() {
697697
std::this_thread::sleep_for(sleep_for);
698698
continue;
699699
}
700-
packetqueue->increment_it(packetqueue_it);
701700

702701
Debug(1, "Adding packet %d", packet->image_index);
703702
this->AddPacket_(packet);
@@ -719,6 +718,8 @@ void Event::Run() {
719718
} // end if packet->image
720719
Debug(1, "Deleting packet lock");
721720
delete packet_lock;
721+
// Important not to increment it until after we are done with the packet because clearPackets checks for iterators pointing to it.
722+
packetqueue->increment_it(packetqueue_it);
722723
} else {
723724
return;
724725
} // end if packet_lock

0 commit comments

Comments
 (0)