Skip to content

Commit

Permalink
Prevent OverlayClient destructor from hanging on disconnect
Browse files Browse the repository at this point in the history
Limit the maximum time a clean disconnect may take to 1s. Previously
our GUI thread could become semi-permanently blocked.
  • Loading branch information
hacst committed Apr 30, 2015
1 parent 9a2c0ee commit ad1ed22
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/mumble/OverlayClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,12 @@ OverlayClient::~OverlayClient() {
delete qgpiCursor;
delete qgpiLogo;

qlsSocket->disconnect();
qlsSocket->abort();
qlsSocket->disconnectFromServer();
if (!qlsSocket->waitForDisconnected(1000)) {
qDebug() << "OverlayClient: Failed to cleanly disconnect: " << qlsSocket->errorString();
qlsSocket->abort();
}

qlsSocket->deleteLater();

ougUsers.reset();
Expand Down

0 comments on commit ad1ed22

Please sign in to comment.