Prevent needless refresh tasks being created when opening the memory inspection pane
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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<Targets::TargetMemoryBuffer> data;
|
||||
std::optional<QSharedPointer<ReadTargetMemory>> activeRefreshTask;
|
||||
|
||||
QWidget* container = nullptr;
|
||||
QHBoxLayout* subContainerLayout = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user