mirror of
https://github.com/feather-wallet/feather.git
synced 2025-03-12 09:37:47 +00:00
WebsocketClient: fix potential crash
This commit is contained in:
parent
005de6ed4f
commit
efda517503
2 changed files with 7 additions and 0 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue