summaryrefslogtreecommitdiff
path: root/examples/triage/exports.cpp
diff options
context:
space:
mode:
authorJordan Wiens <github@psifertex.com>2025-12-19 15:57:20 -0500
committerJordan Wiens <github@psifertex.com>2025-12-19 16:05:02 -0500
commit34622adc292cb10b84c7984fc0cef966ee2c19b7 (patch)
treeb08efae7118bbc20ffbd4f0b4a25bb8ae3d7e42a /examples/triage/exports.cpp
parentdbdf3381e2dd32527cffaca6081fc5a9913f1cc7 (diff)
fix strings missing race condition
Diffstat (limited to 'examples/triage/exports.cpp')
-rw-r--r--examples/triage/exports.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/examples/triage/exports.cpp b/examples/triage/exports.cpp
index c9f0e42d..776044c5 100644
--- a/examples/triage/exports.cpp
+++ b/examples/triage/exports.cpp
@@ -32,7 +32,7 @@ GenericExportsModel::GenericExportsModel(QWidget* parent, BinaryViewRef data): Q
connect(m_updateTimer, &QTimer::timeout, this, &GenericExportsModel::updateModel);
connect(this, &GenericExportsModel::updateTimerOnUIThread, this, [=, this]() {
updateTimer(m_needsUpdate);
- });
+ }, Qt::QueuedConnection);
m_data->RegisterNotification(this);
@@ -260,19 +260,26 @@ void GenericExportsModel::updateTimer(bool needsUpdate)
void GenericExportsModel::pauseUpdates()
{
m_updatesPaused = true;
+ m_dirtyWhilePaused = false;
setNeedsUpdate(false);
}
void GenericExportsModel::resumeUpdates()
{
m_updatesPaused = false;
- setNeedsUpdate(true);
+ // Only refresh if we got notifications while paused
+ if (m_dirtyWhilePaused.exchange(false))
+ setNeedsUpdate(true);
}
void GenericExportsModel::onBinaryViewNotification()
{
if (m_updatesPaused)
+ {
+ // Track that updates occurred while hidden
+ m_dirtyWhilePaused = true;
return;
+ }
// This can be called from any thread so we cannot directly
// update the timer. Emitting a signal is relatively expensive