Skip to content

Commit 4f156ee

Browse files
Merge pull request #48 from southbridgeio/fix-client-dispose
Fix client dispose
2 parents 2ac2d14 + 95bfc58 commit 4f156ee

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

ChangeLog.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
### 3.0.1 / 2020-06-29
2+
3+
* Fix client dispose
4+
5+
### 3.0.0 / 2020-06-28
6+
7+
* Extract schema to separate gem
8+
19
### 2.1.0 / 2019-10-18
210

311
* Support tdlib 1.5

lib/tdlib/client.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,10 @@ def ready?
167167
private
168168

169169
def handle_update(update)
170-
return unless update.is_a?(TD::Types::AuthorizationState::Closed)
170+
return unless update.is_a?(TD::Types::Update::AuthorizationState) && update.authorization_state.is_a?(TD::Types::AuthorizationState::Closed)
171171
@alive = false
172172
@ready = false
173+
sleep 0.001
173174
TD::Api.client_destroy(@td_client)
174175
throw(:client_closed)
175176
end

0 commit comments

Comments
 (0)