diff --git a/ChangeLog.md b/ChangeLog.md index 23a6040..7f49935 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,3 +1,11 @@ +### 3.0.1 / 2020-06-29 + +* Fix client dispose + +### 3.0.0 / 2020-06-28 + +* Extract schema to separate gem + ### 2.1.0 / 2019-10-18 * Support tdlib 1.5 diff --git a/lib/tdlib/client.rb b/lib/tdlib/client.rb index 072c729..7946b65 100644 --- a/lib/tdlib/client.rb +++ b/lib/tdlib/client.rb @@ -167,9 +167,10 @@ def ready? private def handle_update(update) - return unless update.is_a?(TD::Types::AuthorizationState::Closed) + return unless update.is_a?(TD::Types::Update::AuthorizationState) && update.authorization_state.is_a?(TD::Types::AuthorizationState::Closed) @alive = false @ready = false + sleep 0.001 TD::Api.client_destroy(@td_client) throw(:client_closed) end