mirror of
https://github.com/jankae/LibreVNA.git
synced 2026-01-04 15:50:13 +01:00
Capture parentTile value, fix crash on macOS (#292)
This commit is contained in:
parent
b6f26eb6dc
commit
b9523b4864
|
|
@ -417,8 +417,11 @@ void TracePlot::finishContextMenu()
|
|||
contextmenu->addAction(removeTile);
|
||||
connect(removeTile, &QAction::triggered, [=]() {
|
||||
markedForDeletion = true;
|
||||
QTimer::singleShot(0, [=](){
|
||||
parentTile->closeTile();
|
||||
// 'this' object will be deleted when returning function but the following lambda
|
||||
// might be executed after that and we still need to know which tile to close.
|
||||
// Capture parentTile explicitly by value
|
||||
QTimer::singleShot(0, [p=this->parentTile](){
|
||||
p->closeTile();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue