mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-29 13:20:54 +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:
@@ -312,7 +312,7 @@ void ShaderViewer::debugShader(const ShaderBindpointMapping *bind, const ShaderR
|
||||
|
||||
rdcstr disasm = r->DisassembleShader(m_Pipeline, m_ShaderDetails, "");
|
||||
|
||||
GUIInvoke::call([this, targets, disasm]() {
|
||||
GUIInvoke::call(this, [this, targets, disasm]() {
|
||||
QStringList targetNames;
|
||||
for(const rdcstr &t : targets)
|
||||
{
|
||||
@@ -909,7 +909,7 @@ void ShaderViewer::disassemble_typeChanged(int index)
|
||||
m_Ctx.Replay().AsyncInvoke([this, target](IReplayController *r) {
|
||||
rdcstr disasm = r->DisassembleShader(m_Pipeline, m_ShaderDetails, target.data());
|
||||
|
||||
GUIInvoke::call([this, disasm]() {
|
||||
GUIInvoke::call(this, [this, disasm]() {
|
||||
m_DisassemblyView->setReadOnly(false);
|
||||
m_DisassemblyView->setText(disasm.c_str());
|
||||
m_DisassemblyView->setReadOnly(true);
|
||||
|
||||
Reference in New Issue
Block a user