mirror of
https://github.com/quickshell-mirror/quickshell.git
synced 2026-10-27 02:54:36 +00:00
fix(socket): clear buffer when closing/opening socket
This commit is contained in:
2 files changed
+3
-1
No files matched your search
@@ -37,7 +37,7 @@ protected:
|
||||
private slots:
|
||||
void onReaderDestroyed();
|
||||
|
||||
private:
|
||||
protected:
|
||||
DataStreamParser* mReader = nullptr;
|
||||
QByteArray buffer;
|
||||
};
|
||||
|
||||
@@ -41,6 +41,7 @@ void Socket::setPath(QString path) {
|
||||
}
|
||||
|
||||
void Socket::onSocketConnected() {
|
||||
this->buffer.clear();
|
||||
this->connected = true;
|
||||
this->targetConnected = false;
|
||||
this->disconnecting = false;
|
||||
@@ -52,6 +53,7 @@ void Socket::onSocketDisconnected() {
|
||||
this->disconnecting = false;
|
||||
this->socket->deleteLater();
|
||||
this->socket = nullptr;
|
||||
this->buffer.clear();
|
||||
emit this->connectionStateChanged();
|
||||
|
||||
if (this->targetConnected) this->connectPathSocket();
|
||||
|
||||
Reference in new issue
Block a user