Fix broken capture in hellovulkancubes example

Amends 339323b999

Capturing a function argument (or any local variable)
by address is a bad idea.

Fixes: QTBUG-118912
Fixes: QTBUG-118986
Change-Id: I521d319a37f7acd6c66732f5f7d3cf1be4d49029
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
This commit is contained in:
Laszlo Agocs 2023-11-09 12:55:06 +01:00
parent 2ac50bb0f5
commit 9ee30b1dc2

View File

@ -42,7 +42,7 @@ MainWindow::MainWindow(VulkanWindow *vulkanWindow)
pauseButton->setFocusPolicy(Qt::NoFocus);
connect(quitButton, &QPushButton::clicked, qApp, &QCoreApplication::quit);
connect(newButton, &QPushButton::clicked, vulkanWindow, [this, &vulkanWindow] {
connect(newButton, &QPushButton::clicked, vulkanWindow, [this, vulkanWindow] {
vulkanWindow->addNew();
m_count = vulkanWindow->instanceCount();
counterLcd->display(m_count);