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:
@@ -402,7 +402,7 @@ void CaptureDialog::vulkanLayerWarn_mouseClick()
|
||||
if(admin)
|
||||
{
|
||||
RunProcessAsAdmin(qApp->applicationFilePath(),
|
||||
QStringList() << lit("--install_vulkan_layer") << lit("root"),
|
||||
QStringList() << lit("--install_vulkan_layer") << lit("root"), this,
|
||||
[this]() { ui->vulkanLayerWarn->setVisible(false); });
|
||||
return;
|
||||
}
|
||||
@@ -435,7 +435,7 @@ void CaptureDialog::CheckAndroidSetup(QString &filename)
|
||||
if(!debuggable && !hasroot)
|
||||
{
|
||||
// Check failed - set the warning visible
|
||||
GUIInvoke::call([this]() {
|
||||
GUIInvoke::call(this, [this]() {
|
||||
ui->androidScan->setVisible(false);
|
||||
ui->androidWarn->setVisible(true);
|
||||
});
|
||||
@@ -443,7 +443,7 @@ void CaptureDialog::CheckAndroidSetup(QString &filename)
|
||||
else
|
||||
{
|
||||
// Check passed, either app is debuggable or we have root - no warnings needed
|
||||
GUIInvoke::call([this]() {
|
||||
GUIInvoke::call(this, [this]() {
|
||||
ui->androidScan->setVisible(false);
|
||||
ui->androidWarn->setVisible(false);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user