Skip to content
Snippets Groups Projects
Commit 9d931fc6 authored by Sebastian Gaida's avatar Sebastian Gaida
Browse files

[#89] copy handle for lambda before it runs out of scope

parent f335010a
No related branches found
No related tags found
1 merge request!90Resolve "Mehrere Fenster, Abhängigkeiten von Core zu Fenster+Swapchain etc"
Pipeline #27003 passed
...@@ -26,8 +26,9 @@ namespace vkcv { ...@@ -26,8 +26,9 @@ namespace vkcv {
SwapchainHandle swapchainHandle = swapchainManager.createSwapchain(*window); SwapchainHandle swapchainHandle = swapchainManager.createSwapchain(*window);
if (resizeable) { if (resizeable) {
const event_handle<int, int> &resizeHandle = window->e_resize.add([&](int width, int height) { const event_handle<int, int> &resizeHandle = window->e_resize.add([&,handle=swapchainHandle](int width, int height) {
swapchainManager.signalRecreation(swapchainHandle); // copy handle because it would run out of scope and be invalid
swapchainManager.signalRecreation(handle);
}); });
window->m_resizeHandle = resizeHandle; window->m_resizeHandle = resizeHandle;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment