mirror of
https://github.com/wownero/wowlet.git
synced 2026-10-26 02:38:33 +01:00
WebsocketClient: fix potential crash
This commit is contained in:
@@ -117,3 +117,9 @@ void WebsocketClient::onbinaryMessageReceived(const QByteArray &message) {
|
||||
|
||||
emit WSMessage(object);
|
||||
}
|
||||
|
||||
WebsocketClient::~WebsocketClient() {
|
||||
// webSocket may fire QWebSocket::disconnected after WebsocketClient is destroyed
|
||||
// explicitly disconnect to prevent crash
|
||||
webSocket.disconnect();
|
||||
}
|
||||
@@ -15,6 +15,7 @@ class WebsocketClient : public QObject {
|
||||
|
||||
public:
|
||||
explicit WebsocketClient(QObject *parent = nullptr);
|
||||
~WebsocketClient() override;
|
||||
void start();
|
||||
void restart();
|
||||
void stop();
|
||||
|
||||
Reference in New Issue
Block a user