mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +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:
@@ -106,7 +106,7 @@ void APIInspector::on_apiEvents_itemSelectionChanged()
|
||||
m_Ctx.Replay().AsyncInvoke([this, ev](IReplayController *) {
|
||||
rdcarray<rdcstr> stack = m_Ctx.Replay().GetCaptureAccess()->GetResolve(ev.callstack);
|
||||
|
||||
GUIInvoke::call([this, stack]() { addCallstack(stack); });
|
||||
GUIInvoke::call(this, [this, stack]() { addCallstack(stack); });
|
||||
});
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user