mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 01:20:42 +00:00
Speculative fix for race during performance counter selection
* If the window is closed while counter enumeration is happening and that takes long enough this might break, so keep a QPointer around.
This commit is contained in:
@@ -253,17 +253,21 @@ PerformanceCounterSelection::PerformanceCounterSelection(ICaptureContext &ctx,
|
||||
|
||||
ui->counterTree->setMouseTracking(true);
|
||||
|
||||
ctx.Replay().AsyncInvoke([this, selectedCounters](IReplayController *controller) {
|
||||
QPointer<PerformanceCounterSelection> ptr(this);
|
||||
ctx.Replay().AsyncInvoke([this, ptr, selectedCounters](IReplayController *controller) {
|
||||
QVector<CounterDescription> counterDescriptions;
|
||||
for(const GPUCounter counter : controller->EnumerateCounters())
|
||||
{
|
||||
counterDescriptions.append(controller->DescribeCounter(counter));
|
||||
}
|
||||
|
||||
GUIInvoke::call(this, [counterDescriptions, selectedCounters, this]() {
|
||||
SetCounters(counterDescriptions);
|
||||
SetSelectedCounters(selectedCounters);
|
||||
});
|
||||
if(ptr)
|
||||
{
|
||||
GUIInvoke::call(this, [counterDescriptions, selectedCounters, this]() {
|
||||
SetCounters(counterDescriptions);
|
||||
SetSelectedCounters(selectedCounters);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user