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 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) {
|
if (this->targetMemoryDescriptor.type != Targets::TargetMemoryType::RAM) {
|
||||||
QObject::connect(
|
QObject::connect(
|
||||||
@@ -421,6 +432,7 @@ namespace Bloom::Widgets
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this->activeRefreshTask = readMemoryTask;
|
||||||
this->taskProgressIndicator->addTask(readMemoryTask);
|
this->taskProgressIndicator->addTask(readMemoryTask);
|
||||||
InsightWorker::queueTask(readMemoryTask);
|
InsightWorker::queueTask(readMemoryTask);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/TaskProgressIndicator/TaskProgressIndicator.hpp"
|
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/TaskProgressIndicator/TaskProgressIndicator.hpp"
|
||||||
|
|
||||||
#include "src/Insight/InsightWorker/Tasks/InsightWorkerTask.hpp"
|
#include "src/Insight/InsightWorker/Tasks/InsightWorkerTask.hpp"
|
||||||
|
#include "src/Insight/InsightWorker/Tasks/ReadTargetMemory.hpp"
|
||||||
|
|
||||||
#include "HexViewerWidget/HexViewerWidget.hpp"
|
#include "HexViewerWidget/HexViewerWidget.hpp"
|
||||||
#include "MemoryRegionManager/MemoryRegionManagerWindow.hpp"
|
#include "MemoryRegionManager/MemoryRegionManagerWindow.hpp"
|
||||||
@@ -58,6 +59,7 @@ namespace Bloom::Widgets
|
|||||||
const Targets::TargetMemoryDescriptor& targetMemoryDescriptor;
|
const Targets::TargetMemoryDescriptor& targetMemoryDescriptor;
|
||||||
|
|
||||||
std::optional<Targets::TargetMemoryBuffer> data;
|
std::optional<Targets::TargetMemoryBuffer> data;
|
||||||
|
std::optional<QSharedPointer<ReadTargetMemory>> activeRefreshTask;
|
||||||
|
|
||||||
QWidget* container = nullptr;
|
QWidget* container = nullptr;
|
||||||
QHBoxLayout* subContainerLayout = nullptr;
|
QHBoxLayout* subContainerLayout = nullptr;
|
||||||
|
|||||||
Reference in New Issue
Block a user