mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-29 21:30:53 +00:00
GUIInvoke takes a QObject* to avoid callbacks after object lifetime
* The GUIInvoke object takes a QObject, and uses QPointer to check that it hasn't been deleted when the callback fires. This prevents delayed callbacks from executing after the object has been deleted and crashing. * In most cases the pointer is just 'this'.
This commit is contained in:
@@ -215,7 +215,7 @@ void PerformanceCounterViewer::CaptureCounters()
|
||||
|
||||
const rdcarray<CounterResult> results = controller->FetchCounters(counters);
|
||||
|
||||
GUIInvoke::call([this, results, counterDescriptions, counterIndex]() -> void {
|
||||
GUIInvoke::call(this, [this, results, counterDescriptions, counterIndex]() {
|
||||
ui->counterResults->clear();
|
||||
|
||||
QStringList headers;
|
||||
|
||||
Reference in New Issue
Block a user