aui
aui copied to clipboard
Cycling smart pointers when creating lambda signal-slot connection
auto surface = _new ...;
connect(clicked, surface, [surface]() {
...
});
In this example, surface is referenced in signal-slot connection lambda, causing the surface to never destroy by itself.
Workaround:
auto surface = _new ...;
connect(clicked, surface, [surface = surface.get()]() {
...
});
At least there are should be diagnostics for that.