Skip to content

Commit

Permalink
Stop listening to the socket before disconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
seishun committed Aug 25, 2013
1 parent beae172 commit 929e405
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions steampurple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ static void steam_login(PurpleAccount* account) {
purple_connection_set_state(pc, PURPLE_CONNECTED);
purple_connection_set_display_name(pc, steamID_string);
purple_account_set_string(account, "steamid", steamID_string);
break;
g_free(steamID_string);
return;
case EResult::AccountLogonDenied:
purple_request_input(
/* handle */ NULL,
Expand Down Expand Up @@ -214,10 +215,11 @@ static void steam_login(PurpleAccount* account) {
purple_connection_error_reason(pc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, "Unknown error");
}

purple_input_remove(steam->watcher); // on Linux, steam_close is called too late and Pidgin catches the EOF
g_free(steamID_string);
};

steam->client.onLogOff = [pc](EResult result) {
steam->client.onLogOff = [pc, steam](EResult result) {
switch (result) {
case EResult::LoggedInElsewhere:
case EResult::LogonSessionReplaced:
Expand All @@ -230,6 +232,8 @@ static void steam_login(PurpleAccount* account) {
purple_debug_error("steam", "Unknown logoff eresult: %i\n", result);
purple_connection_error_reason(pc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, "Unknown error");
}

purple_input_remove(steam->watcher); // on Linux, steam_close is called too late and Pidgin catches the EOF
};

steam->client.onSentry = [account](const unsigned char hash[20]) {
Expand Down

0 comments on commit 929e405

Please sign in to comment.