From 6409a42f4bad9655fd2827ff437164e5d0ee3df8 Mon Sep 17 00:00:00 2001 From: John Thacker Date: Wed, 29 Nov 2023 23:25:34 -0500 Subject: [PATCH] Qt: Invalidate the idle dissection timer when clearing packet list When clearing the packet list model (called eventually from closing the capturing file or redissecting), mark the idle dissection timer as invalid so that idle dissection stops. It will be started again by PacketList::captureFileReadFinished() This saves some CPU during what is a fairly intensive and not actually idle time, computing information that might be invalid. In particular, this can prevent some read failures and spurious pop-up error messages when opening a large file and saving it to a different format (so that it is closed, and rescanned for new packet offsets) while idle dissection is still ongoing. The idle dissection can attempt to read packets with the wrong offsets. The error is caught without serious issues, but messages like "pcap: file has X-byte packet, bigger than maximum of Y" would imply to a user that something went wrong with saving the file in the new format. Related to #19486 --- ui/qt/models/packet_list_model.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/qt/models/packet_list_model.cpp b/ui/qt/models/packet_list_model.cpp index 876ae34b8b..0ed61d745f 100644 --- a/ui/qt/models/packet_list_model.cpp +++ b/ui/qt/models/packet_list_model.cpp @@ -180,6 +180,7 @@ void PacketListModel::clear() { endResetModel(); max_row_height_ = 0; max_line_count_ = 1; + idle_dissection_timer_->invalidate(); idle_dissection_row_ = 0; }