22* *
33* ngscopeclient *
44* *
5- * Copyright (c) 2012-2024 Andrew D. Zonenberg and contributors *
5+ * Copyright (c) 2012-2025 Andrew D. Zonenberg and contributors *
66* All rights reserved. *
77* *
88* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
@@ -179,13 +179,13 @@ void PacketManager::Update()
179179 if (key == m_cachekey)
180180 return ;
181181
182- LogTrace (" Updating\n " );
182+ LogTrace (" Updating packet manager with new data at %s \n " , time. PrettyPrint (). c_str () );
183183
184184 // If we get here, waveform changed. Update cache key
185185 m_cachekey = key;
186186
187187 // Remove any old history we might have had from this timestamp
188- RemoveHistoryFrom (time);
188+ RemoveHistoryFrom (time, false );
189189
190190 // Copy the new packets and detach them so the filter doesn't delete them.
191191 // Do the merging now
@@ -307,11 +307,17 @@ void PacketManager::FilterPackets()
307307
308308/* *
309309 @brief Removes all history from the specified timestamp
310+
311+ @param timestamp Time to remove the history from
312+ @param refreshAfter True if we should refresh the list of displayed rows, false to not refresh
313+ (should only be set false in Update())
310314 */
311- void PacketManager::RemoveHistoryFrom (TimePoint timestamp)
315+ void PacketManager::RemoveHistoryFrom (TimePoint timestamp, bool refreshAfter )
312316{
313317 lock_guard<recursive_mutex> lock (m_mutex);
314318
319+ LogTrace (" Removing history from %s\n " , timestamp.PrettyPrint ().c_str ());
320+
315321 auto & packets = m_packets[timestamp];
316322 for (auto p : packets)
317323 {
@@ -323,7 +329,8 @@ void PacketManager::RemoveHistoryFrom(TimePoint timestamp)
323329 m_filteredPackets.erase (timestamp);
324330
325331 // update the list of displayed rows so we don't have anything left pointing to stale packets
326- RefreshRows ();
332+ if (refreshAfter)
333+ RefreshRows ();
327334}
328335
329336void PacketManager::RemoveChildHistoryFrom (Packet* pack)
0 commit comments