Crash fix in management server

This commit is contained in:
pokamest 2021-01-07 19:10:24 +03:00
parent ff557589ee
commit c7dafe9c00
2 changed files with 17 additions and 13 deletions

View file

@ -2,6 +2,8 @@
#define MANAGEMENTSERVER_H
#include <QAbstractSocket>
#include <QPointer>
#include <QSharedPointer>
#include <QString>
class QTcpServer;
@ -22,7 +24,7 @@ public:
QString readLine();
qint64 writeCommand(const QString& message);
QTcpSocket* socket() const;
QPointer<QTcpSocket> socket() const;
signals:
void readyRead();
@ -36,8 +38,8 @@ protected slots:
void onSocketError(QAbstractSocket::SocketError socketError);
protected:
QTcpServer* m_tcpServer;
QTcpSocket* m_socket;
QSharedPointer<QTcpServer> m_tcpServer;
QPointer<QTcpSocket> m_socket;
};
#endif // MANAGEMENTSERVER_H