diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.cpp index 72b5ea35..1976c891 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.cpp @@ -382,6 +382,17 @@ namespace Bloom::Widgets } ); + QObject::connect( + readMemoryTask.get(), + &InsightWorkerTask::finished, + this, + [this, taskId = readMemoryTask->id] { + if (this->activeRefreshTask.has_value() && this->activeRefreshTask->get()->id == taskId) { + this->activeRefreshTask.reset(); + } + } + ); + // If we're refreshing RAM, the UI should only be updated once we've retrieved the current stack pointer. if (this->targetMemoryDescriptor.type != Targets::TargetMemoryType::RAM) { QObject::connect( @@ -421,6 +432,7 @@ namespace Bloom::Widgets ); } + this->activeRefreshTask = readMemoryTask; this->taskProgressIndicator->addTask(readMemoryTask); InsightWorker::queueTask(readMemoryTask); } diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.hpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.hpp index 86a779af..0f342cd5 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.hpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.hpp @@ -20,6 +20,7 @@ #include "src/Insight/UserInterfaces/InsightWindow/Widgets/TaskProgressIndicator/TaskProgressIndicator.hpp" #include "src/Insight/InsightWorker/Tasks/InsightWorkerTask.hpp" +#include "src/Insight/InsightWorker/Tasks/ReadTargetMemory.hpp" #include "HexViewerWidget/HexViewerWidget.hpp" #include "MemoryRegionManager/MemoryRegionManagerWindow.hpp" @@ -58,6 +59,7 @@ namespace Bloom::Widgets const Targets::TargetMemoryDescriptor& targetMemoryDescriptor; std::optional data; + std::optional> activeRefreshTask; QWidget* container = nullptr; QHBoxLayout* subContainerLayout = nullptr;