mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-26 10:45:37 +08:00
[FS9] Fix double deletion of CFs9Host
CFs9Host was guarded by a QSharedPointer plus it had a QObject parent.
This commit is contained in:
committed by
Mat Sutcliffe
parent
23c41a408b
commit
f60a44ea1e
@@ -30,7 +30,7 @@ namespace BlackSimPlugin
|
|||||||
return cats;
|
return cats;
|
||||||
}
|
}
|
||||||
|
|
||||||
CDirectPlayPeer::CDirectPlayPeer(QObject *parent, const CCallsign &callsign)
|
CDirectPlayPeer::CDirectPlayPeer(const CCallsign &callsign, QObject *parent)
|
||||||
: QObject(parent),
|
: QObject(parent),
|
||||||
m_callsign(callsign),
|
m_callsign(callsign),
|
||||||
m_callbackWrapper(this, &CDirectPlayPeer::directPlayMessageHandler)
|
m_callbackWrapper(this, &CDirectPlayPeer::directPlayMessageHandler)
|
||||||
|
|||||||
@@ -13,7 +13,6 @@
|
|||||||
#include "hostnode.h"
|
#include "hostnode.h"
|
||||||
#include "callbackwrapper.h"
|
#include "callbackwrapper.h"
|
||||||
#include "blackmisc/aviation/callsign.h"
|
#include "blackmisc/aviation/callsign.h"
|
||||||
#include "blackmisc/worker.h"
|
|
||||||
#include "blackmisc/logcategorylist.h"
|
#include "blackmisc/logcategorylist.h"
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
@@ -38,7 +37,7 @@ namespace BlackSimPlugin
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
//! Constructor
|
//! Constructor
|
||||||
CDirectPlayPeer(QObject *parent, const BlackMisc::Aviation::CCallsign &callsign);
|
CDirectPlayPeer(const BlackMisc::Aviation::CCallsign &callsign, QObject *parent = nullptr);
|
||||||
|
|
||||||
//! Destructor
|
//! Destructor
|
||||||
virtual ~CDirectPlayPeer() override;
|
virtual ~CDirectPlayPeer() override;
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ namespace BlackSimPlugin
|
|||||||
CFs9Client::CFs9Client(const CSimulatedAircraft &remoteAircraft,
|
CFs9Client::CFs9Client(const CSimulatedAircraft &remoteAircraft,
|
||||||
const CTime &updateInterval,
|
const CTime &updateInterval,
|
||||||
CInterpolationLogger *logger, ISimulator *simulator) :
|
CInterpolationLogger *logger, ISimulator *simulator) :
|
||||||
CDirectPlayPeer(simulator, remoteAircraft.getCallsign()),
|
CDirectPlayPeer(remoteAircraft.getCallsign(), simulator),
|
||||||
m_remoteAircraft(remoteAircraft),
|
m_remoteAircraft(remoteAircraft),
|
||||||
m_updateInterval(updateInterval),
|
m_updateInterval(updateInterval),
|
||||||
m_interpolator(remoteAircraft.getCallsign(), simulator, simulator, simulator->getRemoteAircraftProvider(), logger),
|
m_interpolator(remoteAircraft.getCallsign(), simulator, simulator, simulator->getRemoteAircraftProvider(), logger),
|
||||||
|
|||||||
@@ -24,8 +24,8 @@ namespace BlackSimPlugin
|
|||||||
{
|
{
|
||||||
namespace Fs9
|
namespace Fs9
|
||||||
{
|
{
|
||||||
CFs9Host::CFs9Host(QObject *owner) :
|
CFs9Host::CFs9Host(QObject *parent) :
|
||||||
CDirectPlayPeer(owner, sApp->swiftVersionString())
|
CDirectPlayPeer(sApp->swiftVersionString(), parent)
|
||||||
{
|
{
|
||||||
initDirectPlay();
|
initDirectPlay();
|
||||||
createHostAddress();
|
createHostAddress();
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ namespace BlackSimPlugin
|
|||||||
};
|
};
|
||||||
|
|
||||||
//! Constructor
|
//! Constructor
|
||||||
CFs9Host(QObject *owner);
|
CFs9Host(QObject *parent = nullptr);
|
||||||
|
|
||||||
//! Destructor
|
//! Destructor
|
||||||
virtual ~CFs9Host() override;
|
virtual ~CFs9Host() override;
|
||||||
|
|||||||
@@ -553,7 +553,7 @@ namespace BlackSimPlugin
|
|||||||
|
|
||||||
CSimulatorFs9Factory::CSimulatorFs9Factory(QObject *parent) :
|
CSimulatorFs9Factory::CSimulatorFs9Factory(QObject *parent) :
|
||||||
QObject(parent),
|
QObject(parent),
|
||||||
m_fs9Host(new CFs9Host(this), cleanupFs9Host),
|
m_fs9Host(new CFs9Host, cleanupFs9Host),
|
||||||
m_lobbyClient(new CLobbyClient, cleanupLobbyClient)
|
m_lobbyClient(new CLobbyClient, cleanupLobbyClient)
|
||||||
{
|
{
|
||||||
registerMetadata();
|
registerMetadata();
|
||||||
|
|||||||
Reference in New Issue
Block a user