Skip to content

Commit

Permalink
Don't incremenet event it until we are done with the packet
Browse files Browse the repository at this point in the history
  • Loading branch information
Isaac Connor committed Jul 26, 2024
1 parent b613d56 commit 1ae223b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/zm_event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,6 @@ void Event::Run() {
std::this_thread::sleep_for(sleep_for);
continue;
}
packetqueue->increment_it(packetqueue_it);

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

0 comments on commit 1ae223b

Please sign in to comment.