Fix LED's not turning off when program ends

This commit is contained in:
kevin 2019-06-23 09:10:24 -04:00
parent acafd14ec2
commit 02fc46794f

View File

@ -7,13 +7,16 @@ hgx11net::hgx11net(QString host, ushort port)
_sock_p = new QTcpSocket(this); _sock_p = new QTcpSocket(this);
_host_m = host; _host_m = host;
_port_m = port; _port_m = port;
this->_connectHost(); _connectHost();
} }
hgx11net::~hgx11net() hgx11net::~hgx11net()
{ {
clearLeds(); clearLeds();
_sock_p->disconnectFromHost(); if (_sock_p->state() == QAbstractSocket::ConnectedState) {
while(_sock_p->waitForBytesWritten()) {}
_sock_p->disconnectFromHost();
}
} }
void hgx11net::clearLeds() void hgx11net::clearLeds()