From acf6da4226b49ec22e1d37dd913bbacadf2bda52 Mon Sep 17 00:00:00 2001 From: Mat Sutcliffe Date: Sat, 27 Nov 2021 20:03:52 +0000 Subject: [PATCH] [FS9] Fix a crash (pure virtual call) --- src/plugins/simulator/fs9/fs9client.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/simulator/fs9/fs9client.cpp b/src/plugins/simulator/fs9/fs9client.cpp index fcc53cab6..0484ab0d8 100644 --- a/src/plugins/simulator/fs9/fs9client.cpp +++ b/src/plugins/simulator/fs9/fs9client.cpp @@ -167,6 +167,10 @@ namespace BlackSimPlugin::Fs9 { closeConnection(); SafeRelease(m_hostAddress); + + // This needs to be disconnected before calling the base class destructor, + // otherwise the slot can be called after the derived class is destroyed. + disconnect(this, &CFs9Client::connectionComplete, this, &CFs9Client::handleConnectionCompleted); } void CFs9Client::sendTextMessage(const QString &textMessage)