Issue #11 CEventLoop uses QPointer trick to guard against use-after-free

See https://blogs.kde.org/2009/03/26/how-crash-almost-every-qtkde-application-and-how-fix-it-0
This commit is contained in:
Mat Sutcliffe
2021-09-28 18:49:05 +01:00
parent 02d0f40c6d
commit 2ac222f700
4 changed files with 28 additions and 5 deletions

View File

@@ -182,7 +182,7 @@ namespace BlackCore
// with this little trick we try to make an asynchronous signal / slot based approach
// a synchronous return value
CEventLoop eventLoop;
CEventLoop eventLoop(this);
eventLoop.stopWhen(m_fsdClient, &CFSDClient::flightPlanReceived, [ = ](const auto &cs, const auto &) { return cs == callsign; });
if (eventLoop.exec(1500))
{